Button
A React component in Beamline's Actions category, in the free sample.
The action control: five weights and a brand fill, a buy/sell tone, sm/md/lg and a 44 px touch size, icon-only, a loading state that keeps its size and focus, and a label that changes in place.
Use it for
- Any action that happens on click: submit, save, open, run. One primary (or accent) per view.
Not for
- Navigation to another page (a link; or asChild around the link when it must look like a button).
- A destructive action that needs friction (confirm-morph or hold-to-confirm).
- Several related actions (split-button or dropdown-menu).
Anatomy
- root (button, or the child element with asChild)
- leading icon (any icon element among the children, before the text)
- label (the text; its width follows the text when it changes; in a room narrower than the button it ends in an ellipsis)
- loader (a spinner that opens in front of the label while loading)
Variants
- variant: primary, secondary, outline, ghost, danger, accent
- size: sm, md, lg, touch (44 px, bottom action bars on phones)
- shape: text (padding on both sides), icon-only (square; iconOnly, or detected when no words sit anywhere among the children: an icon or a frame of icons; an element with words, like <span>Close</span>, is a label)
- tone: up (buy: --pui-up fill or label), down (sell: --pui-down fill or label)
States
- rest
- hover (arrives at once, leaves over --pui-motion-out)
- pressed (scale 0.97, icon/sm 0.95, at 0ms; none on popup anchors or with reduced motion)
- focus (the look's focus ring, never animated)
- disabled (--pui-opacity-disabled)
- working (loading: loader opens in front of the label, size and focus kept, aria-busy, clicks ignored)
- resolved (the caller changes the label in place, e.g. Save → Saved; never reverted by a timer)
- error (the caller keeps or restores the label and shows the message next to the cause; the button never turns red)
Keyboard
- Enter / Space activate (native button)
- Tab focuses; focus stays on the button through loading
Motion
Hover colour arrives at 0ms and leaves over --pui-motion-out. Press scales to 0.97 at once (narrow buttons 0.95) and springs back. A changed label slides up out of a soft blur while the width follows on spring.morph; the loader opens its width from 0 so nothing jumps. Reduced motion: colour changes only, no scale, no slide. When the label changes, the leaving words are hidden from assistive tech at once: the accessible name is the new label the moment it changes, not both while the old one animates away.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "primary" | "secondary" | "outline" | "ghost" | "danger" | "accent" | "primary" | Visual weight: primary (ink-filled), secondary, outline, ghost, danger, or accent (filled with the brand). |
size | "sm" | "md" | "lg" | "touch" | "md" | Height 32 / 36 / 40 px; touch 44 px for a bottom action bar on a phone. |
tone | "up" | "down" | — | Market side. On primary/accent the fill becomes --pui-up (buy) or --pui-down (sell); on the quiet variants the label takes that colour. Pair it with a word or arrow: colour is never the only signal. |
loading | boolean | — | Shows a loader in front of the label, sets aria-busy and ignores clicks; size and focus stay. |
look | "soft" | "blueprint" | "glass" | "metal" | "glow" | "pop" | "mono" | "ink" | — | Paint this button in another look than the one in force around it (DESIGN-LANGUAGE.md "Looks"). |
asChild | boolean | — | Render the single child (a link, a Radix trigger) with the button's look instead of a <button>. |
iconOnly | boolean | — | A square button holding only an icon (give it an aria-label). Decided by the children when left out: icon-only when no words sit anywhere among them (an icon, or a frame of icons), so `<span>Close</span>` is a label. |
...button attributes | ButtonHTMLAttributes | — | type defaults to "button". Icon-only buttons need aria-label. |
classNames | Partial<Record<"root" | "label" | "loader", string>> | — | Classes for the named visual parts; no overrides by default. |
ref | Ref<HTMLButtonElement> | — | Receives the documented native target or imperative handle; omitted by default. |
Built from
Used in
- Account ledger
- Security
- Accounting workbench
- Action center
- Admin users
- Agency book
- Agent builder
- Agent runs monitor
- AI agent workspace
- Analytics dashboard
- API keys & webhooks
- Applicant company
- Applicant projects
- Appointment book
- Approval policy
- Artifact workbench
- Asset library
- Asset packs
- Asset workspace
- Audience segments
- Audit log
- Audit room
- Auth page
- Automation runs
- Automation steps
- Benefit changes
- Billing & invoices
- Billing desk
- Services and hours
- Budget month
- Bulk item edit
- Call sheet
- Captions
- Care plan
- Case workspace
- Category manager
- Change orders
- Changelog feed
- Insurance claims
- Click heatmap
- Book an appointment
- Client forms
- Client journal
- Content workbench
- Collection batch edit
- Company access
- Component properties
- Component source
- Condition checklist
- Contact profile
- Content releases
- Conversation history
- Corrective actions
- Correlation editor
- Counter service
- Course builder
- Course dashboard
- Course home
- Crew booking
- CRM pipeline
- Customer requests
- Cut review
- Cycle planner
- Dashboard controls
- Dashboard panels
- Data binding
- Database builder
- Day agenda
- Design inputs
- Desk booking
- Dispensing
- Document finder
- Document history
- Document review
- Domain verification
- Draft orders
- Drawing board
- Electrical design
- Email automation
- Empty states
- Engineering changes
- Equipment register
- Estimate share
- Event evidence
- Event registration
- External review
- Field conditions
- File detail
- File manager
- Flight logbook
- Flight record
- Flight route
- Gift batches
- Gift desk
- Goods receiving
- Grading desk
- Grazing plan
- Guest messages
- Guest review
- Health questionnaire
- Helpdesk inbox
- Hiring pipeline
- Hours ledger
- AI image studio
- Import runs
- Inspection review
- Instructor finder
- Instrument use
- Intake triage
- Integrations
- Inventory counts
- Inventory finder
- Inventory item
- Invoices
- Issue workbench
- Issued ticket
- Item setup
- Itinerary
- Job booking
- Job booking setup
- Job card
- Job materials
- Kit builder
- Knowledge base manager
- Label designer
- Language preview
- Lease renewals
- Lease setup
- Link booking
- Linked appointments
- Localization overview
- Maintenance plan
- Maintenance plans
- Map annotations
- Map explorer
- Market screener
- Matrix question
- Media collection
- Meeting and call review
- Messaging journeys
- Metadata fields
- Model inspector
- Model issues
- Model playground
- Model workbench
- My shift
- Newsletter desk
- Note templates
- Notification preferences
- Nutrition library
- Onboarding checklist
- Order board
- Order changes
- Order closeout
- Order composer
- Order detail
- Order history and fills
- Order ledger
- Orders admin
- Owner records
- Pack station
- Packages & memberships
- Page editing
- Page header
- Page inline edit
- Parcel record
- Participant review
- Parts tracker
- Patient chart
- Patient overview
- Payroll approvals
- Payroll cycles
- Payroll run
- Permit application
- Permit fees
- Permit record
- Permit services
- Pipeline record
- Pipeline views
- Plan acceptance
- Plan comparison
- Plan follow-up
- Plan readiness
- Plan templates
- Planner setup
- Playbook check
- Policy rules
- Portfolio overview
- Post performance
- Post release
- Pre-flight briefing
- Print quote
- Print scheduler
- Probing chart
- Procedure picker
- Product analytics
- Product editor
- Production and lots
- Production plan
- Program modules
- Program setup
- Project board
- Project browser
- Project directory
- Project home
- Project periods
- Project signals
- Projects
- Proposal payments
- Protocol builder
- Prototype review
- Prototype task
- Publishing team
- Purchase order desk
- Purchase orders
- Purchase request
- Purchasing rules
- Quality checks
- Query library
- Question builder
- Queue display
- Queue settings
- Reading library
- Reconciliation
- Record catalogue
- Record editor
- Record import
- Record search
- Record settings
- Record setup
- Record sharing
- Record versions
- Recruiter home
- Rental availability
- Rental policy
- Report builder
- Report library
- Research synthesis
- Reservation desk
- Resource booking
- Resource rules
- Rooms & equipment
- Restock desk
- Results notebook
- Retention analysis
- Return case
- Return queue
- Return request
- Review page builder
- Review share
- Rig editor
- Roles & permissions
- Roof layout
- Room readiness
- Roster publishing
- Route plan
- Run of show
- Sales dashboard
- Sample ledger
- Sample storage
- Saved views
- Scan station
- Schema fields
- Screenplay revisions
- Segment editor
- Serial allocation
- Service estimate
- Service tasks
- Session notes and tasks
- Session replay
- Settings
- Shared inbox
- Shift briefing
- Shift planner
- Shift rotations
- Shipment split
- Shop floor
- Shot list
- Sign in
- Signature fields
- Signing request
- Sign up form
- Slide presenter
- Slot editor
- Social media scheduler
- Solar quote
- Sound library
- Special orders
- Stage reports
- Status dashboard
- Stay folio
- Step form
- Stock alerts
- Stock count
- Stock moves
- Stop runs
- Study flow
- Study setup
- Submittal register
- AI support chat
- AI support console
- System pages
- Table service
- Tag manager
- Task results
- Team calendar
- Team chat
- Team & members
- Telemetry explorer
- Text styles
- Ticket orders
- Ticket setup
- Timesheet review
- Tracker desk
- Trading terminal
- Training progress
- Transaction review
- Transition sequence
- Translation editor
- Translation key
- Translation workbench
- Treatment plan
- Tree test
- Trip budget
- Turntable review
- Versioned dashboard
- Versioned document
- Visit board
- Visitor desk
- Visitor journey
- Voice agent
- Volunteer rota
- Waitlist desk
- Work orders
- Workflow builder
- Workflow composer
- Workflow library
- Workflow versions
- Workout logger
- Workout planner
- Workspace switcher
- Writing canvas
Dependencies
motion, radix-ui
Import
import { Button } from "@beamline/button";
Get it
Button is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Button is included in the free MIT sample. Get Beamline · Connect your agent
More in Actions
- Consequence preview: A risky action that shows what it will do before it runs: one headline sentence, what blocks it and what it also reaches as bands, then the rest as cards…
- Theme switch: The light/dark control: the page changes in one of four transitions starting from the button (reveal, eclipse, split, rise), and the icon turns between…
- Confirm morph: A destructive action that asks in place: the button morphs into its question, then into working, then into the result with Undo or Retry, without a dialog.
- Swipe actions: Row actions behind a swipe on touch screens and a two-finger swipe on a trackpad, and at the row's end for pointer and keyboard (a ⋯ menu in a narrow…
- Hold to confirm: Confirms a costly action by holding instead of clicking: a fill sweeps across while held and drains if let go early; pointer, touch, Space and Enter all…
- Split button: One obvious action joined to a menu of close alternatives; both halves are real buttons and the menu uses the shared menu rows.
- Copy button: Copies a value and confirms in place: the icon becomes a check and the label says Copied; a refused copy says so instead of pretending.