Skip to main content
IconButton
@coinbase/cds-web@8.56.1
A Button with an Icon for content.
import { IconButton } from '@coinbase/cds-web/buttons/IconButton'
Related components

IconButton is a compact button that displays only an icon. Use it for actions where the icon alone clearly communicates the purpose.

Basics

The only required props are name (which determines the icon) and accessibilityLabel (for screen readers).

Loading...

Variants

Use variants to denote intent and importance. The active prop fills the icon when enabled.

Loading...

Transparent

Use the transparent prop to remove the background until the user interacts with the button.

Loading...

States

Loading

Use the loading prop when an action is in progress. The button becomes non-interactive and shows an indeterminate ProgressCircle instead of the icon. The circle size follows the button’s iconSize.

Loading by variant

Loading works with all variants, transparent, and compact. Provide accessibilityLabel so screen readers announce the loading state (e.g. "Loading").

Loading...

Interactive loading

Toggle loading to simulate an async action. The button’s accessibilityLabel can reflect the state (e.g. "Submit form" vs "Processing submission").

Loading...

Disabled

Use the disabled prop to prevent interaction and show a disabled visual state.

Loading...

Sizing

IconButtons are compact by default. Use compact={false} for larger touch targets.

Loading...

Accessibility

Since icon buttons have no visible text, an accessibilityLabel is required to describe the button's purpose for screen readers.

<IconButton name="close" accessibilityLabel="Close trade modal" />

When composing a button with a visible label, use accessibilityLabelledBy to reference the label's id instead. See the Claim Drop example below.

For most use cases, keep the IconButton target area at 40 x 40 or larger. Reserve iconSize="xs" for specific constrained layouts, and avoid shrinking the interactive area below 24 x 24, which is the absolute minimum target size recommended by WCAG 2.2 target size guidance.

Composed Examples

Claim Drop

A toggleable icon button with an adjacent label. Uses accessibilityLabelledBy to associate the button with its visible label.

Loading...

Notification Bell

An icon button with a badge showing the notification count. Uses DotCount to display the number of unread notifications.

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.