Skip to main content
GOV UI Lightweight UI for government software.

Button

Use Button for actions.

When to use it

When not to use it

Examples

Each example is a conformance case: every emitter — React, and each framework adapter — is checked against exactly this markup.

primary

Rendered
HTML
<button class="gov-button gov-button--primary gov-button--md" type="button">Save</button>
{
  "children": "Save"
}

secondary

Rendered
HTML
<button class="gov-button gov-button--secondary gov-button--md" type="button">Cancel</button>
{
  "variant": "secondary",
  "children": "Cancel"
}

danger

Rendered
HTML
<button class="gov-button gov-button--danger gov-button--md" type="button">Delete</button>
{
  "variant": "danger",
  "children": "Delete"
}

small

Rendered
HTML
<button class="gov-button gov-button--primary gov-button--sm" type="button">Filter</button>
{
  "size": "sm",
  "children": "Filter"
}

disabled

Rendered
HTML
<button class="gov-button gov-button--primary gov-button--md" type="button" disabled>Save</button>
{
  "attributes": {
    "disabled": true
  },
  "children": "Save"
}

submit

Rendered
HTML
<button class="gov-button gov-button--primary gov-button--md" type="submit">Save</button>
{
  "attributes": {
    "type": "submit"
  },
  "children": "Save"
}

Variants

Variants
Prop Values Default
variantprimary, secondary, dangerprimary
sizesm, mdmd

Accessibility

Accessible name. Visible text content. An icon-only button requires aria-label.

Keyboard behavior
Key Behavior
EnterActivates the button.
SpaceActivates the button.

Class names

Class names
Role Class
base.gov-button
variant.gov-button--{variant}
size.gov-button--{size}

View the manifest for this component: packages/manifest/components/button.json