Dither

A one-pixel pencil, with shift for straight lines.
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/tab-dither

About this component

Bitmap tool tabs on a pixel bar: the chosen tab is a one-bit dithered pill, and switching hops it over in steps and fills it in from a sparse pattern to solid, while the pill it left thins out pixel layer by layer.

Dependencies
None
Difficulty
Intermediate
Reduced motion
Respected
Theme
Light and dark
Follows page color-scheme

Triggers3

  • Click
  • State change
  • Delay stagger

Techniques3

  • Conic gradient
  • Keyframes
  • CSS variables

Accessibility

Keyboard and screen readers

Real ARIA tabs: arrow keys, Home and End move between tabs, only the selected tab is in the Tab order, and each panel is labelled by its tab. Decoration is aria-hidden.

Reduced motion

The pill appears solid in place.

Use it in anything you build, commercial and client work included. Licence

More tabs

See all
Everything is allowed here, including the bad ideas.
EmphasisGet code
Thirty minutes at f/4 with the camera on the wall.
ExposureGet code
Every ten minutes into the centre until midnight.
FlipdotGet code
Card, tissue and crepe, cut and folded into shapes.
GlitterGet code