Reveal

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/checkbox-reveal

About this component

Send me a copy: ticking it draws a line down from the box that turns into an email field below and puts the cursor in it; unticking folds it away.

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

Triggers4

  • Click
  • State change
  • Draw
  • Focus

Techniques3

  • CSS transition
  • stroke-dashoffset
  • SVG stroke

Accessibility

Keyboard and screen readers

A native checkbox in a <label> with aria-expanded and aria-controls pointing at the field. Ticking moves focus to the email field, which has its own label; while folded away it is out of the tab order.

Reduced motion

It opens at once.

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

More checkboxes

See all
RSVPGet code
RubbingGet code
ShippingMira Patel14 Harbour RoadBristol BS1 4QA
Same addressGet code
Smart guidesGet code