Matrix Chevron Button
A tactile dual-bezel keycap CTA button with a spring-expanding dot-matrix chevron pill, continuous traveling wave animation, and dynamic color-derived contrast.
Features
- Spring-expanding glossy keycap pill that reveals a symmetrical row of 10-dot matrix chevrons across any label width.
- Scoped CSS keyframe wave animation running at 60fps without React re-renders, configurable via
waveSpeed. - Automatic relative-luminance color derivation for bevel highlights, inner shadows, ink contrast, and ambient glow from any
accentColorandchassisColor. - Supports both
click(toggle withEscapecollapse) andhovertrigger modes, controlled or uncontrolled state, andprefers-reduced-motion.
Use cases
- High-impact hero call-to-action buttons, demo booking triggers, and waitlist submissions.
- Hardware-inspired interactive controls and expandable action pills.
Installation
pnpm dlx shadcn@latest add @abushaidislam/matrix-chevron-button
Usage
import { MatrixChevronButton } from "@/components/matrix-chevron-button"export default function HeroCta() {
return (
<div className="flex min-h-80 items-center justify-center p-8">
<MatrixChevronButton
label="Book a demo"
accent="lime"
size="md"
trigger="hover"
/>
</div>
)
}API reference
MatrixChevronButton
Prop
Type
Accessibility
- Renders a native
<button>witharia-label,aria-pressedinclickmode, andEscapekey collapse. - Focus-visible outline adapts dynamically to the resolved
accentColor. - Respects
prefers-reduced-motionby disabling spring transitions, tap scaling, and the dot-matrix wave animation.
License and usage
- Free to use and modify in both personal and commercial projects.
- Attribution is appreciated but not required.
- Released under the MIT License.
Every component here is built and maintained by one person. If you enjoy using them, you can sponsor my work.