Button
<Button>TailwindCSS ModulesButtons trigger immediate actions, state commits, or navigation. Coloxo UI buttons provide predictable touch/click boundaries, standard WCAG 2.1 AA focus-visible indicator rings, 5 enterprise control heights, and 8 semantic variants engineered for high-density SaaS and financial platforms.
npx coloxo add button --style coloxo-cssimport { Button } from '@coloxo/ui';Design Tokens:
1. Variant Matrix
Every variant rendered across Default, Hover, Active, Focus, and Disabled states at medium height (40px).
| Variant | Default | Hover | Active | Focus | Disabled | Loading |
|---|---|---|---|---|---|---|
| primary | ||||||
| secondary | ||||||
| secondary-brand | ||||||
| tertiary | ||||||
| primary-destructive | ||||||
| secondary-destructive | ||||||
| tertiary-destructive | ||||||
| link-color | ||||||
| link-gray |
2. Control heights
Coloxo UI aligns all form inputs, selects, segmented controls, and buttons to strict 4px grid increments via --cx-control-height-*.
Sizes
size="xs"High-density tables, grid row actions
size="sm"Secondary dialogs, data toolbars
size="md"DEFAULTStandard forms, dialog footers
size="lg"Marketing / checkout actions
size="xl"Hero CTAs, mobile touch targets
3. Icons & Groups
Leading / trailing icons
Button group
4. Interactive Props Configurator
<Button icon={<Plus />}> Deploy to Production</Button>5. Dark theme
Calibrated for deep dashboard backgrounds (#0F172A and #020617), preserving AA accessibility without harsh pure-white borders.
primarySolid brand blue #2348FF
secondarySlate surface + border
secondary-brandDeep navy + brand text
primary-destructiveSolid red-600 + focus glow
6. Enterprise layout compositions
Demonstrating hierarchy, alignment, icon pairing, and density in professional SaaS environments.
Accessibility
Buttons are fully focusable and triggerable via Space and Enter keys.
Loading states automatically apply aria-busy="true" to announce to screen readers.
All button variants meet WCAG 2.1 AA contrast requirements (4.5:1).
Props
| Name | Type | Default | Description |
|---|---|---|---|
| variant | "primary" | "secondary" | "secondary-brand" | "tertiary" | "primary-destructive" | "secondary-destructive" | "tertiary-destructive" | "link-color" | "link-gray" | primary | Visual style. |
| size | "xs" | "sm" | "md" | "lg" | "xl" | md | Control height (32–48px). |
| loading | boolean | — | Shows spinner and disables the button. |
| fullWidth | boolean | — | Stretch to container width. |
| icon | ReactNode | — | Optional icon slot. |
| iconPosition | "left" | "right" | left | Icon placement. |