Button

Markdown

A labeled action in a few sizes and levels of emphasis.

Used in Recoverable chat, Action receipts, Workspace integrations and 7 more patterns.

Use it for
An action: save, submit, open, run; or, with href, a call to action that navigates.
Not for
Text links inside sentences. Try IconButton or Card.

Button preview

Activate the button to test the callback.

Installation

npm install @stackunseen/ui
import { Button } from '@stackunseen/ui';
Styles: @stackunseen/ui/styles.css

Usage and props

Use for an action such as saving or opening a panel. Give it clear text; use IconButton when the action only has an icon. Use a link for navigation.

childrenReactNode (optional)
The visible button label.
onClick(event: MouseEvent<HTMLButtonElement>) => void (optional)
Handles activation. Track pending, success and failure in your application.
type'button' | 'submit' | 'reset' (optional)
Defaults to button. Set submit when it should submit a form.
variant'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'link' (optional)
Visual emphasis. Defaults to primary; danger suits a destructive action.
size'default' | 'sm' (optional)
Use sm for a compact secondary action. Omit it for the regular size.
disabledboolean (optional)
Prevents activation. Explain unavailable actions near the button.
How state and callbacks work
All props

Loading…

For your coding agent

Give the agent this page instead of a screenshot. The prompt wraps the page with the install and import lines and the rule that your server, not a click, completes an action.

Contract
variant?: primary | secondary | outline | ghost | danger | link · size?: default | sm · href? target? rel? (renders a link) · native button props
Keeps honest
Use a label that says what happens, and match the emphasis to how important the action is. Your app decides when it’s busy or disabled.
MCP
read_component "Button" on the docs endpoint
Open the Markdown file

Keyboard and customization

Keyboard

Tab focuses an available button; Enter or Space activates it. Native disabled buttons are not focusable. This component defaults to type="button"; opt into type="submit" for forms.

Customization

Change shared colors, spacing, corners and icons with the theme. Use the component's supported props to adapt its content and layout. Customization guide and Theme Studio