Button
Primary action, secondary action, negative action, text action, icon action, loading, and disabled states.
Variants
Sizes and states
Button.Text
Button.Icon
Button.Icon sizes
Button
import { Button } from 'regen-ui'
export function Actions() {
return (
<>
<Button variant="primary">Continue</Button>
<Button variant="secondary">Cancel</Button>
<Button loading>Saving…</Button>
</>
)
}Button.Text
import { Button } from 'regen-ui'
export function InlineAction() {
return <Button.Text>View details</Button.Text>
}Button.Icon
import { Button } from 'regen-ui'
import { MoreHorizontal } from 'lucide-react'
export function MenuButton() {
return (
<Button.Icon title="More options">
<MoreHorizontal />
</Button.Icon>
)
}API Reference
Button.Props
| Name | Type | Default | Description |
|---|---|---|---|
icon | ReactNode | None | Icon or element before the label. |
loading | boolean | false | Show a loading spinner and disable the button. |
render | ReactElement | None | Element to render as instead of `<button>` (e.g. `<a href="…" />` for navigation). |
size | 'large' | 'medium' | 'small' | 'medium' | Button size variant. |
variant | 'negative' | 'primary' | 'secondary' | 'secondary' | Button visual variant. |
Inherits ButtonHTMLAttributes<HTMLButtonElement>. | |||
iconType
ReactNodeDefaultNone
Icon or element before the label.loadingType
booleanDefault
Show a loading spinner and disable the button.falserenderType
ReactElementDefaultNone
Element to render as instead of `<button>` (e.g. `<a href="…" />` for navigation).sizeType
'large' | 'medium' | 'small'Default
Button size variant.'medium'variantType
'negative' | 'primary' | 'secondary'Default
Button visual variant.'secondary'Inherits
ButtonHTMLAttributes<HTMLButtonElement>.Button.Icon.Props
| Name | Type | Default | Description |
|---|---|---|---|
ref | Ref<HTMLButtonElement> | None | Button ref. |
size | 'lg' | 'md' | 'sm' | 'xs' | 'sm' | Icon button size. |
title | string | None | Accessible label for the icon-only button. |
variant | 'default' | 'plain' | 'surface' | 'default' | Visual style: 'default' for filled icon buttons, 'plain' for transparent icon buttons, or 'surface' for bordered icon buttons. |
Inherits ButtonHTMLAttributes<HTMLButtonElement>. | |||
refType
Ref<HTMLButtonElement>DefaultNone
Button ref.sizeType
'lg' | 'md' | 'sm' | 'xs'Default
Icon button size.'sm'titleType
stringDefaultNone
Accessible label for the icon-only button.variantType
'default' | 'plain' | 'surface'Default
Visual style: 'default' for filled icon buttons, 'plain' for transparent icon buttons, or 'surface' for bordered icon buttons.'default'Inherits
ButtonHTMLAttributes<HTMLButtonElement>.Button.Text.Props
| Name | Type | Default | Description |
|---|---|---|---|
prefix | ReactNode | None | Icon or element before the label. |
render | ReactElement | None | Element to render as instead of `<button>` (e.g. `<a href="…" />` for navigation). |
size | 'large' | 'medium' | 'small' | 'medium' | Text button size. |
suffix | ReactNode | None | Icon or element after the label. |
Inherits ButtonHTMLAttributes<HTMLButtonElement>, except prefix. | |||
prefixType
ReactNodeDefaultNone
Icon or element before the label.renderType
ReactElementDefaultNone
Element to render as instead of `<button>` (e.g. `<a href="…" />` for navigation).sizeType
'large' | 'medium' | 'small'Default
Text button size.'medium'suffixType
ReactNodeDefaultNone
Icon or element after the label.Inherits
ButtonHTMLAttributes<HTMLButtonElement>, except prefix.