Button
Pill buttons with depth, plus an optional flicker grid that follows the cursor in any colour.
Preview
Setup
Install with the shadcn CLI
One command adds every file, the npm packages and any Kinetik components it builds on. Needs a components.json; the CLI offers to create one if your project has none.
Or install manually
- 1
Run in your terminal:
$npm install clsx tailwind-merge class-variance-authority @radix-ui/react-slot - 2
Copy
lib/utils.tsfrom the Code tab. Skip if you already havecn(). - 3
Copy
styles/tokens.cssfrom the Code tab and import it in your global CSS after Tailwind:@import "./styles/tokens.css"; - 4
Create a
components/ui/button/folder and copy every file from the Code tab into it. Each file does one job, so you can read or change a piece without the rest. - 5
Import and render:
Exampleimport { Button } from "@/components/ui/button" <Button>Get started</Button> <Button variant="secondary" flicker flickerColor="#38bdf8" flickerSize={4}> Hover me </Button>
API Surface
| Prop | Type | Default | Notes |
|---|---|---|---|
variant | "default" | "secondary" | "outline" | "ghost" | "destructive" | "link" | "default" | Filled pill, soft pill, bordered, bare, red, or a text link. |
size | "sm" | "default" | "lg" | "icon" | "default" | 28, 32 or 40 px tall; icon is a 32 px circle. |
flicker | boolean | false | A grid of squares flickers around the cursor while it moves over the button, then fades out. |
flickerColor | string | text colour | Any CSS colour for the squares, e.g. #38bdf8 or var(--brand). |
flickerSize | number | 3 | Side of each flicker square in px; the gap between squares scales with it. |
asChild | boolean | false | Render your own element, e.g. a Link, with the button styles. |
All other props pass straight through to the native button element, so you can
set type="submit", disabled, aria-* attributes, and event handlers as
needed.
Accessibility
- Always pair icon-only buttons with
aria-label - Disabled buttons set
aria-disabledand skip pointer events, so rely on theonClickguard server-side as well - Focus ring follows the theme colours
- The flicker grid is decorative (
aria-hidden) and is hidden when the visitor prefers reduced motion