Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
A squircle button that changes shape to show its state.
npx shadcn@latest add ikislay/pixel-ui/buttonimport { useState } from "react"import { Button, type ButtonStatus } from "@/components/ui/button"export function Demo() {const [status, setStatus] = useState<ButtonStatus>("idle")async function save() {setStatus("loading")await fetch("/api/save", { method: "POST" })setStatus("success")setTimeout(() => setStatus("idle"), 1500)}return <Button status={status} onClick={save}>Save changes</Button>}
1// Loading…
Options you can pass to customize this component.
statusidleloadingsuccesserrorWhat the button is doing. Anything but idle shows an icon and ignores clicks.
variantprimarysecondaryghostdestructiveThe look while idle. Primary uses the brand blue.
sizesmmdlgiconHeight and padding. Icon is a square for a single icon.
onFeedback(event: "press" | "error") => voidCalled at each semantic moment, for wiring sound or haptics.
classNamestringMerged onto the root element.