Skip to content
Actions

Button

Starts an action. One primary button per view; start every label with a verb.

import { Button } from "@flinbu/seed";

Variants

Primary for the main action, secondary next to it, ghost and tertiary for quieter actions, destructive for what can't be undone.

import { Button } from "@flinbu/seed";
import { Trash2 } from "lucide-react";

<Button>Save changes</Button>
<Button variant="secondary">Cancel</Button>
<Button variant="tertiary">Duplicate</Button>
<Button variant="ghost">Skip</Button>
<Button variant="destructive" leftIcon={<Trash2 />}>Delete token</Button>
<Button variant="success">Approve</Button>
<Button variant="link">Read the guide</Button>

Sizes

32, 40 and 48 px tall. Heights follow the theme's density.

import { Button } from "@flinbu/seed";

<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>

With icons

import { Button } from "@flinbu/seed";
import { Plus, Search, ArrowRight } from "lucide-react";

<Button leftIcon={<Plus />}>New token</Button>
<Button variant="secondary" rightIcon={<ArrowRight />}>Continue</Button>
<Button variant="ghost" icon={<Search />} aria-label="Search" />

Loading and disabled

import { Button } from "@flinbu/seed";

<Button loading>Saving</Button>
<Button disabled>Disabled</Button>
<Button variant="secondary" disabled>Disabled</Button>

Use it for

  • Saving, creating, confirming: anything that changes something.
  • variant="link" for a quiet action inside text.

Use something else for

  • Navigation to another page: use a link (or Button with href).
  • Labels like OK or Submit: name the action.

Props

PropTypeDefaultDescription
variant'primary''secondary''tertiary''ghost''destructive''success''link''primary'Visual weight.
size'sm''md''lg''md'sm 32px, md 40px, lg 48px.
leftIconIconProp–Icon before the label. An element like <Search /> (works in server components) or, in client components, the component itself.
rightIconIconProp–Icon after the label. An element like <Search /> (works in server components) or, in client components, the component itself.
iconIconProp–Makes a square icon-only button. Needs aria-label. An element like <Search /> (works in server components) or, in client components, the component itself.
loadingbooleanfalseSpinner in place of the left icon; ignores clicks but stays readable and focusable.
fullWidthbooleanfalseStretches to its container.
hrefstring–Renders an <a> with the same look.
asChildbooleanfalseStyles your own element, like a router Link.
classNamestring–Extra classes. They win over Seed's, so you can adjust one thing without forking.

Accessibility

  • A real <button> (or <a> with href) with a visible focus ring.
  • Icon-only buttons need aria-label.
  • loading keeps the button's colors and focus, sets aria-busy and aria-disabled, and ignores clicks so it can't be pressed twice.