Skip to main content
Button
@coinbase/cds-web@8.34.1
A pressable button element.
Import
import { Button } from '@coinbase/cds-web/buttons/Button'
SourceView source codeStorybookView StorybookFigmaView Figma (internal only)
Related components
View as Markdown

Buttons allow users to take actions and make choices with a single tap. They communicate what action will occur when the user interacts with them.

Basics

The only required prop is children, which is the button's label. Buttons default to the primary variant.

Loading...

Variants

Use variants to communicate the importance and intent of an action.

  • Primary — High emphasis for main actions like "Save" or "Confirm". Limit to one per screen.
  • Secondary — Medium emphasis for multiple actions of equal weight.
  • Tertiary — High contrast with inverted background.
  • Negative — Destructive actions that can't be undone. Use sparingly.
Loading...

Transparent

Use transparent buttons for supplementary actions with lower prominence. The container is only visible on interaction. Works with any variant.

Loading...

States

Loading

Use the loading prop to indicate an action is in progress. The button becomes non-interactive and displays a spinner while preserving its width.

Loading...

Disabled

Use the disabled prop to prevent interaction and indicate the action is unavailable.

Loading...

Sizing

Compact

Use compact for smaller buttons with reduced padding. Useful in dense UIs or alongside other compact elements.

Loading...

Block

Use block to make the button expand to fill its container width.

Loading...

Icons

End Icon

Add an icon after the label to provide additional context or indicate direction.

Loading...

Start Icon

Add an icon before the label to reinforce the action.

Loading...

Full Width with Icons

When using block with icons, the content automatically spreads across the button width.

Loading...

Accessibility

Buttons automatically use their children as the accessible label. For buttons with only icons or ambiguous labels, provide an accessibilityLabel.

<Button onClick={handleClose} accessibilityLabel="Close dialog">
×
</Button>

Composed Examples

Confirmation Dialog

A common pattern using primary and secondary buttons together.

Loading...

Destructive Confirmation

Use negative buttons with a secondary cancel option for destructive actions.

Loading...

Form Actions

A full-width primary action with a compact secondary option.

Loading...

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.