Fork

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/button-fork

About this component

A split button that really splits. Pressing the chevron half parts the two halves and drops a short list of ways to do the action; the one you pick rolls into the main label as the halves close again.

Triggers

  • Click
  • State change
  • Spring
  • Icon

Techniques

  • State machine
  • CSS transition
  • Keyframes
  • Transform only

Difficulty

Advanced

Accessibility

Keyboard and screen readers

A group of two native buttons: the main action, and a chevron with aria-haspopup=menu and aria-expanded. Options are role=menuitemradio with aria-checked and are only tabbable while open. Escape and outside clicks close the list.

Reduced motion

Everything switches without animation.

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

More buttons

See all
FrostedGet code
GleamGet code
GlossGet code
InkGet code