Button
The kit's signature button: on hover or keyboard focus a grid of squares dissolves in behind the label, then the label switches to the ink color. The squares are created on the first interaction only.
Renders a <button type="button"> unless asChild is set. All native button props (onClick, disabled, type, form…) are passed through.
import { Button } from "pixelbits/button";
export default function Demo() {
return (
<div className="flex flex-wrap items-center gap-3">
<Button variant="primary">Get started</Button>
<Button>Secondary</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="danger">Delete</Button>
<Button roll>Rolling label</Button>
<Button loading>Saving</Button>
</div>
);
}Installation
import { Button } from "pixelbits/button";npx shadcn add https://pixelbits.ali-moradi-develop.com/r/button.jsonAPI
<Button>
The kit's signature button: on hover or keyboard focus a grid of squares dissolves in behind the label, then the label switches to the ink color. The squares are created on the first interaction only.
Renders a <button type="button"> unless asChild is set. All native button props (onClick, disabled, type, form…) are passed through.
<Button variant="primary" onClick={save}>Save</Button>
<Button loading>Saving</Button>
<Button asChild><a href="/docs">Read the docs</a></Button>| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "primary" | "secondary" | "outline" | "ghost" | "danger" | "secondary" | Visual style.
|
| size | "sm" | "md" | "lg" | "icon-sm" | "icon" | "icon-lg" | "md" | Height and padding.
|
| asChild | boolean | false | Render the only child element instead of a |
| pixel | boolean | true | The pixel dissolve on hover and keyboard focus. Set |
| loading | boolean | false | Shows a pixel spinner before the label, sets |
| roll | boolean | false | The label rolls up on hover and focus while a copy comes in from below (as in the full-screen menu). Only for plain text labels, and not with |
Also accepts every prop of ButtonHTMLAttributes<HTMLButtonElement>.