115 Components
Expanding Arrow Button
ButtonsAn interactive pill button featuring a spring-expanding accent block that morphs from an idle dotted chevron into a kinetic ordered Bayer dither pattern on hover and keyboard focus.
NewButtonsDither PatternSpring PhysicsA11y Ready
Installation
Install directly into your project using the shadcn CLI or copy the source code manually.
Requires:framer-motionclsxtailwind-merge
$npx shadcn@latest add "https://boseui.site/r/expanding-arrow-button.json"
Props
TypeScript props supported by <ExpandingArrowButton />.
| Prop | Type | Default | Description |
|---|---|---|---|
| childrenrequired | ReactNode | — | Text or elements displayed inside the button. |
| accentClassName | string | "bg-lime-300 text-neutral-950" | Custom classes for the expanding accent block surface. |
| labelClassName | string | — | Custom classes for the default unexpanded label text. |
| expandedLabelClassName | string | — | Custom classes for the label text when expanded over the dither surface. |
| showLabelOnExpand | boolean | true | Whether to render the text label over the dither pattern when expanded. |
| ditherClassName | string | — | Custom classes for the animated dither pattern container. |
| stiffness | number | 420 | Spring physics stiffness value for the pill expansion. |
| damping | number | 30 | Spring physics damping value for the pill expansion. |
Key Features
- Smooth layout-spring expansion from a compact 52px pill to full button width.
- Integrated ordered Bayer 4x4 dither pattern with seamless continuous animation.
- Kinetic wave columns that pulse and oscillate across the expanded surface.
- Smart touch handling with useHoverCapable to prevent sticky hover states on mobile.
- Seamless keyboard focus activation with high-contrast visible focus rings.
- Tactile press spring feedback (whileTap={{ scale: 0.97 }}).
- Automatic compliance with prefers-reduced-motion.
Keyboard & Accessibility
- Uses semantic HTML <button> element with full keyboard tab focus.
- Focus triggers the same kinetic expansion as hover, ensuring parity for keyboard users.
- Visible high-contrast focus rings with focus-visible.
- Respects prefers-reduced-motion by substituting spring physics with instantaneous transitions.