Actions / Button
Button
Trigger an action with clear visual states.
Customize
Props · 7
| Prop | Default | Description |
|---|---|---|
variant"primary" | "secondary" | "quiet" | "destructive" | "link" | "primary" | Intent: how much the action stands out. |
size"default" | "xs" | "sm" | "lg" | "default" | Height, padding and type size. |
recipe"plain" | "press-key" | "band-bevel" | "support-rail" | "inner-rim" | "plain" | Shape recipe: edge, depth and press motion. |
loadingboolean | false | Pending work: busy pattern, blocks clicks, keeps focus. |
disabledboolean | false | Unavailable: dashed edge, no depth. |
offlineboolean | false | Needs a connection: adds an Offline label and disables. |
childrenstring | "Export selection" | Label. |
Usage
import { Button } from "@/components/ui/button"
<Button>Export selection</Button>Install
Paste this prompt into your coding agent. It installs through the registry and adds the 1bitcn rules to AGENTS.md.
Install Button from 1bitcn (@1bitcn/button) in this project.
1bitcn is a shadcn registry of 1-bit React components. Every theme has exactly two paints: ink and paper.
1. If the project has no components.json, run `npx shadcn@latest init` first.
2. Add the registry: `npx shadcn@latest registry add @1bitcn=https://1bitcn.com/r/{name}.json`
3. Install: `npx shadcn@latest add @1bitcn/button` (it also brings @1bitcn/base: theme, CSS and the agent skill). If the project uses another package runner (pnpm dlx, yarn dlx, bunx), you may use it instead. Do not copy files by hand.
4. Add this note to AGENTS.md (create the file if needed; skip if it is already there):
## 1bitcn
- UI comes from the 1bitcn shadcn registry (@1bitcn). Catalog: https://1bitcn.com/llms.txt. Full rules: .agents/skills/1bitcn/SKILL.md
- Each theme has two paints, ink and paper. Middle tones come from the monochrome ramp tokens (--bit-ink-soft, --bit-mid, --bit-paper-deep, --bit-scrim). Add no other colors.
- Show state with shape, border, pattern or label, not hue. Add items with `shadcn add @1bitcn/<name>`, not by hand.
5. Use it with this configuration. If it is unclear where it belongs, ask before editing:
```tsx
import { Button } from "@/components/ui/button"
<Button>Export selection</Button>
```
6. Check: the project typechecks and builds, and the component from `@/components/ui/button` renders.
Docs: https://1bitcn.com/docs/components/button.mdInclude source
Optional: let your agent browse the registry with npx shadcn@latest mcp init.
States
In use
Recipes
- Plain action
- Frequent actions in a dense interface.
- Keycap
- A deliberate primary action.
- Retained key
- A setting that stays selected. Needs a retained pressed state.
- Band bevel
- A tactile action with hard tonal bands.
- Support rail
- An action resting on a visible lower rail.
- Inner rim
- An action with an internal boundary.
Keyboard
Use Tab to reach the component. The base style supplies a visible double focus outline.
Motion engine
Loading motion options…