Skip to content

Button

frontend-react/src/components/ui/Button.tsx

Unified button with 6 variants, loading state, and accessible min-height (44px mobile).

Props

PropTypeDefaultDescription
variantprimary | secondary | danger | ghost | icon | table-actionprimaryVisual style
sizesm | md | lgmdSize preset
loadingbooleanfalseShows spinner, disables button
tenantColorstring#C5A059Override primary color
...restHTMLButtonAttributesForwarded to <button>

Usage

tsx
<Button variant="primary" onClick={save}>Salvar</Button>
<Button variant="danger" loading={deleting}>Excluir</Button>
<Button variant="table-action">•••</Button>

Notes

  • table-action uses px-3 py-1.5 text-xs (~36px height — acceptable in dense table rows)
  • icon variant: square button for icon-only actions
  • primary adopts --color-tenant CSS token for brand color

Lançado sob a licença MIT.