Command Palette

Search for a command to run...

331K21st.dev views
Components

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.

Loading…
Dependencies (2)

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 accentColor and chassisColor.
  • Supports both click (toggle with Escape collapse) and hover trigger modes, controlled or uncontrolled state, and prefers-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> with aria-label, aria-pressed in click mode, and Escape key collapse.
  • Focus-visible outline adapts dynamically to the resolved accentColor.
  • Respects prefers-reduced-motion by 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.

Was this helpful?

Command Palette

Search for a command to run...