Controls

Button

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Button

Button

A squircle button that changes shape to show its state.

Installation

npx shadcn@latest add ikislay/pixel-ui/button

How to use

import { 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>
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
status
idleloadingsuccesserror

What the button is doing. Anything but idle shows an icon and ignores clicks.

variant
primarysecondaryghostdestructive

The look while idle. Primary uses the brand blue.

size
smmdlgicon

Height and padding. Icon is a square for a single icon.

onFeedback
(event: "press" | "error") => void

Called at each semantic moment, for wiring sound or haptics.

className
string

Merged onto the root element.