Sgraffito

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/tab-sgraffito

About this component

A strip of lime plaster laid over a Pompeian red ground. The picked tab is scratched back to the red in hatched strokes, its label left standing in white plaster, while the old one is trowelled smooth.

Triggers

  • Click
  • State change
  • Fill

Techniques

  • @property
  • Gradient
  • CSS transition
  • CSS variables

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

A WAI-ARIA tablist (aria-label "Finish") of buttons with role="tab", aria-selected and aria-controls, a roving tabindex, Left and Right arrow keys plus Home and End, and one tabpanel per tab; :focus-visible outlines the tab. Every drawn part is aria-hidden.

Reduced motion

The transitions are switched off, so the selection changes at once.

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

More tabs

See all
SwatchGet code
ThermoGet code
TintedGet code
TooledGet code