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

iconOptional
TypeReactNode
DefaultNone
Icon or element before the label.
loadingOptional
Typeboolean
Defaultfalse
Show a loading spinner and disable the button.
renderOptional
TypeReactElement
DefaultNone
Element to render as instead of `<button>` (e.g. `<a href="…" />` for navigation).
sizeOptional
Type'large' | 'medium' | 'small'
Default'medium'
Button size variant.
variantOptional
Type'negative' | 'primary' | 'secondary'
Default'secondary'
Button visual variant.
Inherits ButtonHTMLAttributes<HTMLButtonElement>.

Button.Icon.Props

refOptional
TypeRef<HTMLButtonElement>
DefaultNone
Button ref.
sizeOptional
Type'lg' | 'md' | 'sm' | 'xs'
Default'sm'
Icon button size.
titleOptional
Typestring
DefaultNone
Accessible label for the icon-only button.
variantOptional
Type'default' | 'plain' | 'surface'
Default'default'
Visual style: 'default' for filled icon buttons, 'plain' for transparent icon buttons, or 'surface' for bordered icon buttons.
Inherits ButtonHTMLAttributes<HTMLButtonElement>.

Button.Text.Props

prefixOptional
TypeReactNode
DefaultNone
Icon or element before the label.
renderOptional
TypeReactElement
DefaultNone
Element to render as instead of `<button>` (e.g. `<a href="…" />` for navigation).
sizeOptional
Type'large' | 'medium' | 'small'
Default'medium'
Text button size.
suffixOptional
TypeReactNode
DefaultNone
Icon or element after the label.
Inherits ButtonHTMLAttributes<HTMLButtonElement>, except prefix.