Forms

Button

Action trigger with ten variants, three sizes, optional icons, a loading spinner, and fullWidth. Built over MUI Button but exposes only the agnostic Hub API.

Examples

Variants
Loading preview
<Button variant="primary">Save</Button>
<Button variant="outlined">Cancel</Button>
<Button variant="danger">Delete</Button>
Status (outlined)
Loading preview
<Button variant="outlined-success">Approve</Button>
<Button variant="outlined-warning">Review</Button>
<Button variant="outlined-error">Reject</Button>
Loading
Loading preview
<Button loading>Saving</Button>

API

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'danger' | 'outlined' | 'outlined-secondary' | 'outlined-success' | 'outlined-warning' | 'outlined-error' | 'text' | 'text-secondary'primaryVisual style. The outlined-success / -warning / -error variants are status-colored outlined buttons.
size'small' | 'medium' | 'large'mediumSize of the button.
loadingbooleanfalseShow a spinner and block interaction.
fullWidthbooleanfalseStretch to fill the container width.
leftIcon / rightIconReactNodenoneIcon before or after the label.
disabledbooleanfalseDisable the button.

Styling and attributes

Like every component, Button accepts the universal token style props (m, p, sx, display, responsive maps, ...) and forwards standard DOM attributes (id, data-*, aria-*, event handlers) to the underlying element. See Styling for the full API.

Guidelines

Do

  • Use one primary button per view for the main action.
  • Use danger for destructive actions like delete.

Avoid

  • Do not import Button from @mui/material; always use @hub/ds-components.
  • Do not hardcode colors or sizes; the variant and size props are the API.

Import from @hub/ds-components. Interactive playground: Storybook. Figma Code Connect node 98-439.