Button
An action, or a link that looks like one. One primary per view.
import { Button } from "@forgeron/ui";import { Button } from "@forgeron/ui";
export default function Variants() {
return (
<>
<Button variant="primary">Deploy</Button>
<Button>Preview</Button>
<Button variant="ink">Publish</Button>
<Button variant="ghost">Cancel</Button>
<Button variant="danger">Delete</Button>
</>
);
}import { Button } from "@forgeron/ui";
export default function Sizes() {
return (
<>
<Button size="sm">Small</Button>
<Button>Medium</Button>
<Button size="lg">Large</Button>
</>
);
}import { Button } from "@forgeron/ui";
export default function MarkerAndShortcut() {
return (
<>
<Button variant="primary" marker>
Get started
</Button>
<Button kbd="⌘K">Search</Button>
<Button href="#docs" variant="ink">
Read the docs
</Button>
</>
);
}import { Button } from "@forgeron/ui";
export default function Disabled() {
return (
<>
<Button variant="primary" disabled>
Deploying
</Button>
<Button disabled>Preview</Button>
</>
);
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "primary" | "secondary" | "ink" | "ghost" | "danger" | "secondary" | Primary is filled in ember, black text; danger is destructive. |
size | "sm" | "md" | "lg" | "md" | 30, 32 or 40 px. |
marker | boolean | — | The square marker before the label. |
kbd | string | — | A shortcut on the right, e.g. ⌘K. |
href | string | — | Renders an anchor styled as a button. |
className | string | — | Extra classes. |