Dither button

A button whose far end breaks into a grid of dots, the way the designs.here sky does. Point at it and the dots sweep back across it while the arrow steps forward.

Options

Size
Colour

Code

import "./dither-button.css";

/* quiet gives the raised white version. Its colour can be set with the
   --dh-dbutton-colour variable. */
export function DitherButton({ children, quiet = false, arrow = true, ...props }) {
  return (
    <button className="dh-dbutton" type="button" data-quiet={quiet ? "" : undefined} {...props}>
      {children}
      {arrow && (
        <svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
          <path d="M3 8h9.500M8.500 4l4 4-4 4" />
        </svg>
      )}
    </button>
  );
}