Icon button

An icon button runs an action shown by one icon alone, such as close, share, or more, where space is tight. Its variants set how much attention the action draws, so play stands out and shuffle stays quiet. A built-in badge counts what is waiting, with no element for you to place. Try the player, app bar, and composer below, and watch the inbox badge come and go.

Reference docs⁠

BlazorReactWebOverviewExamplesAPIStylingAccessibility

Choosing a button⁠

Six components share the button's form. Each suits a different job:

  • Button: an action with a name, such as Save, Send invitation, or Delete project.
  • Icon button: an action shown by a relevant icon only, with no label, such as close, share, or more, where space is tight.
  • Floating action button: the one most important action on a screen, floating above the content.
  • FAB menu: a floating action button that opens a short set of related actions, such as new message, new call, or new meeting.
  • Toggle button: a labeled setting that stays on until it is switched off, such as bold or mute.
  • Toggle icon button: the same two-state setting, shown by an icon only, such as bookmark or favorite.

Two jobs belong elsewhere. Words that take the reader somewhere are a link in the text, and a choice among options is a set of chips, radio buttons, or a select.

Choosing a variant⁠

Four variants set how much attention an icon button draws, from most to least:

  • Filled: the one icon action a group most needs, such as play in a media bar or send in a compose area.
  • Tonal: an important action beside a filled one, such as pause or edit.
  • Outlined: a secondary action that still needs a visible edge, such as bookmark or share on a card.
  • Standard: the quietest action, a bare icon for dense rows, such as more, close, or back in an app bar.

Built in⁠

  • badge-value or badge-dot puts a badge on the icon, and badge-concealed hides it and restores it with its count.
  • A plain tooltip from tooltip-value, opening on hover and on keyboard focus, with no separate element to place.
  • A touch target at least 48 by 48 pixels at every size, even where the icon button paints smaller (touch-target).
  • Form submission: type submits the icon button's form or resets it, and a submit sends name with value.
  • A link, from href, that keeps the icon button's shape and colors.
  • A soft-disabled state, soft-disabled, that stops the action and keeps the icon button in the Tab order.

Using icon buttons well⁠

  • Show an action by an icon alone only when the icon is widely recognized; give an action that needs words to a button.
  • Give every icon button an accessible name with aria-label, in the words a sighted reader takes from the icon.
  • Place icon buttons in toolbars, app bars, and other compact layouts, and use one to open a menu or a search.
  • Keep one filled icon button in a group, and make its neighbors tonal, outlined, or standard.

These rules follow Material 3 Expressive's guidance for icon buttons, on material.io.

Variants⁠

Set variant to one of the four variants; Choosing a variant says when each one fits. Omit it and the icon button takes the variant from your style configuration, which is filled unless you have changed it.

Give every icon button an aria-label, because the icon alone gives it no accessible name.

Size and width⁠

size sets the icon button's height and icon size, from extra-small to extra-large. Omit it and the icon button takes the size from your style configuration, which is small unless you have changed it.

width makes the container narrow or wide around the same icon; the style configuration's default is regular. Use a wide icon button where a row has room and the action deserves a larger target, and a narrow one where icon buttons sit tightly side by side.

touch-target decides how the touch area of at least 48 by 48 pixels meets your layout. The style configuration's default, overflow, lets it extend past a smaller button without taking layout space; wrapper makes the icon button take that space; and none shrinks the touch area to the visible button.

Icons⁠

Name a Material Symbols icon in icon-name, or put an icon element such as a cw-icon in the default slot. When both are set, the slotted icon wins and the icon button logs a warning.

On a right-to-left page, flip-icon-in-rtl mirrors an icon-name icon, so a back or forward arrow points the way the page reads. A slotted icon is never mirrored.

Badges⁠

badge-value puts a short count or label on the icon, and badge-dot shows a small dot with no text instead. badge-concealed hides the badge and keeps its value, so clearing it shows the same badge again.

The demo repeats the count in the aria-label, for the reason Names and states gives.

Tooltips⁠

tooltip-value shows a tooltip on hover and on keyboard focus, which is how a sighted reader learns what an icon means. tooltip-position places it; the style configuration's default is end-center.

A tooltip showing the icon button's name, as in the first demo, is the common case; Names and states says what a screen reader makes of it.

title shows the browser's own tooltip instead; prefer tooltip-value, which also opens on keyboard focus.

href makes the icon button a link: a screen reader announces it as one, and a click follows the address. target chooses where it opens; the preview refuses a new tab, so the demo keeps to a jump within itself.

Set aria-label on every link icon button; title does not name a link.

Forms⁠

Inside a form, an icon button submits it: type is submit unless you set it. Set type to reset to reset the form, or to button for an action that leaves the form alone, such as a toolbar's. name and value add a pair to the submitted data, so a form can tell two submit buttons apart.

The preview does not submit forms, so the demo shows each click from on:click; on your page the form submits.

Disabled and soft-disabled⁠

disabled turns an action off completely: the icon button leaves the Tab order and cannot be activated. soft-disabled turns it off and keeps it in the Tab order, so a keyboard or screen reader user can still reach it and hear its tooltip. Use soft-disabled when the reader should find the action and learn why it is unavailable.

A soft-disabled icon button swallows its click, so the demo's status line changes only once the actions are back on.

In a compact layout⁠

Icon buttons earn their place where a label would not fit: the actions on a message, a card, or a row in a list. Each one keeps its own Tab stop, so give each an aria-label that says what it does to this item, and set type to button when the row sits inside a form.

Properties⁠

PropertyAttributeTypeDescription
autofocusautofocusbooleandefault falseRequests focus for the icon button when the page loads, as the native autofocus attribute does.
badgeConcealedbadge-concealedbooleandefault falseHides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges.
badgeDotbadge-dotbooleandefault falseShows the badge as a small dot with no text, whether or not badgeValue is set. See Badges.
badgeValuebadge-valuestringThe badge's text. While it is empty and badgeDot is not set, no badge renders. Ignored if badgeDot is set. See Badges.
disableddisabledbooleandefault falseDisables the icon button: it leaves the Tab order and cannot be focused or activated. See Disabled and soft-disabled.
downloaddownloadstringDownloads the linked URL instead of navigating to it. A file name saves it under that name, and an empty string downloads it under the server's own name, like the bare HTML attribute. Unset, it navigates. Ignored unless href is set.
flipIconInRtlflip-icon-in-rtlbooleandefault falseMirrors the iconName icon when the text direction is right to left. See Icons.
formread-onlyHTMLFormElementThe form the component belongs to, or null when it has none.
hrefhrefstringThe URL that the link icon button points to. When set, the icon button is a link: a screen reader announces it as one, and a click follows the URL instead of submitting or resetting its form. A disabled or soft-disabled link icon button cannot be followed. See Links.
iconNameicon-namestringA Material Symbols icon name. This is an alternative to using the default slot. If both are provided, the slot takes precedence, and a warning is logged. See Icons.
namenamestringThe name the element's value is submitted under with its form. See Forms.
relrelstringThe link's relationship to the linked URL, as the anchor's rel, used exactly as given. Unset, the anchor has no rel. Ignored unless href is set.
sizesizeextra-small, small, medium, large, extra-largeSizeSize.ExtraSmall, .Small, .Medium, .Large, .ExtraLargedefault Size.Small, from the style configurationSets how large the component is, from extra-small to extra-large. A larger size makes it taller. See Size and width.
softDisabledsoft-disabledbooleandefault falseDisables the icon button but keeps it focusable and in the Tab order. It carries aria-disabled="true", and a click on it does nothing and does not bubble past the button; a capture-phase listener still receives it. Use it when a disabled icon button must stay reachable by keyboard and screen reader. For when this is needed, see WAI-ARIA Authoring Practices: disabled controls. See Disabled and soft-disabled.
targettarget_blank, _self, _parent, _top, ""UrlTargetUrlTarget.Blank, .Self, .Parent, .Top, .Emptydefault UrlTarget.EmptyWhere a link icon button opens href. It has no effect without href. Empty, the link opens in the same tab. See Links.
titletitlestringThe native tooltip the browser shows on hover. With no aria-label, it is also the icon button's accessible name, except on a link, which takes its name from aria-label only. See Tooltips, Links.
tooltipPositiontooltip-positionstart-start, start-center, start-end, center-start, center-end, end-start, end-center, end-endTooltipPositionTooltipPosition.StartStart, .StartCenter, .StartEnd, .CenterStart, .CenterEnd, .EndStart, .EndCenter, .EndEnddefault TooltipPosition.EndCenter, from the style configurationWhere the tooltip appears around the element, such as above or beside it. It has no effect without tooltipValue. See Tooltips.
tooltipValuetooltip-valuestringThe tooltip's text. The tooltip opens on hover and on focus, and a screen reader announces it as the control's description unless it only repeats the control's name. No tooltip renders while it is empty. See Tooltips.
touchTargettouch-targetnone, overflow, wrapperTouchTargetTouchTarget.None, .Overflow, .Wrapperdefault TouchTarget.Overflow, from the style configurationThe area that takes a touch, at least 48 by 48 pixels and centered on the component. overflow extends it past the component without changing the component's layout size, wrapper makes the component take up the whole area in the layout, and none limits it to the component's own size. See Size and width.
typetypebutton, reset, submitFormSubmitterBehaviorFormSubmitterBehavior.Button, .Reset, .Submitdefault FormSubmitterBehavior.SubmitWhat a click does to the icon button's form: submit submits it, reset resets it, and button does nothing. It has no effect on a link icon button or outside a form. See Forms, In a compact layout.
valuevaluestringThe value added to a form with the button's name when the button submits a form. See Forms.
variantvariantfilled, outlined, standard, tonalIconButtonVariantIconButtonVariant.Filled, .Outlined, .Standard, .Tonaldefault IconButtonVariant.Filled, from the style configurationSets how strongly the icon button stands out from its surroundings. See Variants.
widthwidthnarrow, regular, wideIconButtonWidthIconButtonWidth.Narrow, .Regular, .Widedefault IconButtonWidth.Regular, from the style configurationSets how wide the icon button is, without changing the size of its icon. A wider button stands out more. See Size and width.

With href set, the icon button is a link and takes no part in its form: type, name, and value are ignored.

Slots⁠

SlotDescription
(default)The icon: a cw-icon or an inline svg. It overrides iconName, and the icon button logs a warning when both are set. Text alone renders nothing.

Events⁠

EventTypeDetailDescription
link-activateLinkActivateEventLinkActivateEventDetailFired when the link is followed in the same tab, before the browser navigates. Cancel it to navigate with a router instead. It bubbles, is composed, and is cancelable.
clickMouseEvent—Dispatched when the icon button is clicked. A disabled or soft-disabled one does not dispatch it. It bubbles, is composed, and is cancelable.

A click that a listener cancels with preventDefault() neither submits nor resets the form.

Props⁠

PropTypeDescription
autofocusbooleandefault falseRequests focus for the icon button when the page loads, as the native autofocus attribute does.
badgeConcealedbooleandefault falseHides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges.
badgeDotbooleandefault falseShows the badge as a small dot with no text, whether or not badgeValue is set. See Badges.
badgeValuestringThe badge's text. While it is empty and badgeDot is not set, no badge renders. Ignored if badgeDot is set. See Badges.
disabledbooleandefault falseDisables the icon button: it leaves the Tab order and cannot be focused or activated. See Disabled and soft-disabled.
downloadstringDownloads the linked URL instead of navigating to it. A file name saves it under that name, and an empty string downloads it under the server's own name, like the bare HTML attribute. Unset, it navigates. Ignored unless href is set.
flipIconInRtlbooleandefault falseMirrors the iconName icon when the text direction is right to left. See Icons.
formread-only (ref)HTMLFormElementThe form the component belongs to, or null when it has none.
hrefstringThe URL that the link icon button points to. When set, the icon button is a link: a screen reader announces it as one, and a click follows the URL instead of submitting or resetting its form. A disabled or soft-disabled link icon button cannot be followed. See Links.
iconNamestringA Material Symbols icon name. This is an alternative to using the default slot. If both are provided, the slot takes precedence, and a warning is logged. See Icons.
namestringThe name the element's value is submitted under with its form. See Forms.
onNavigate(detail: LinkActivateEventDetail, event: LinkActivateEvent) => voidCalled when the link points inside the app: the same origin, opening in the same tab. The browser's navigation is canceled first, so this handler navigates, and it replaces the navigation ChameleonRouterProvider would make.
relstringThe link's relationship to the linked URL, as the anchor's rel, used exactly as given. Unset, the anchor has no rel. Ignored unless href is set.
sizeSizeTypeSize.ExtraSmall, .Small, .Medium, .Large, .ExtraLargedefault Size.Small, from the style configurationSets how large the component is, from extra-small to extra-large. A larger size makes it taller. See Size and width.
softDisabledbooleandefault falseDisables the icon button but keeps it focusable and in the Tab order. It carries aria-disabled="true", and a click on it does nothing and does not bubble past the button; a capture-phase listener still receives it. Use it when a disabled icon button must stay reachable by keyboard and screen reader. For when this is needed, see WAI-ARIA Authoring Practices: disabled controls. See Disabled and soft-disabled.
targetUrlTargetTypeUrlTarget.Blank, .Self, .Parent, .Top, .Emptydefault UrlTarget.EmptyWhere a link icon button opens href. It has no effect without href. Empty, the link opens in the same tab. See Links.
titlestringThe native tooltip the browser shows on hover. With no aria-label, it is also the icon button's accessible name, except on a link, which takes its name from aria-label only. See Tooltips, Links.
tooltipPositionTooltipPositionTypeTooltipPosition.StartStart, .StartCenter, .StartEnd, .CenterStart, .CenterEnd, .EndStart, .EndCenter, .EndEnddefault TooltipPosition.EndCenter, from the style configurationWhere the tooltip appears around the element, such as above or beside it. It has no effect without tooltipValue. See Tooltips.
tooltipValuestringThe tooltip's text. The tooltip opens on hover and on focus, and a screen reader announces it as the control's description unless it only repeats the control's name. No tooltip renders while it is empty. See Tooltips.
touchTargetTouchTargetTypeTouchTarget.None, .Overflow, .Wrapperdefault TouchTarget.Overflow, from the style configurationThe area that takes a touch, at least 48 by 48 pixels and centered on the component. overflow extends it past the component without changing the component's layout size, wrapper makes the component take up the whole area in the layout, and none limits it to the component's own size. See Size and width.
typeFormSubmitterBehaviorTypeFormSubmitterBehavior.Button, .Reset, .Submitdefault FormSubmitterBehavior.SubmitWhat a click does to the icon button's form: submit submits it, reset resets it, and button does nothing. It has no effect on a link icon button or outside a form. See Forms, In a compact layout.
valuestringThe value added to a form with the button's name when the button submits a form. See Forms.
variantIconButtonVariantTypeIconButtonVariant.Filled, .Outlined, .Standard, .Tonaldefault IconButtonVariant.Filled, from the style configurationSets how strongly the icon button stands out from its surroundings. See Variants.
widthIconButtonWidthTypeIconButtonWidth.Narrow, .Regular, .Widedefault IconButtonWidth.Regular, from the style configurationSets how wide the icon button is, without changing the size of its icon. A wider button stands out more. See Size and width.

With href set, the icon button is a link and takes no part in its form: type, name, and value are ignored.

Children⁠

ChildDescription
childrenThe icon: a CrIcon or an inline svg. It overrides iconName, and the icon button logs a warning when both are set. Text alone renders nothing.

Events⁠

PropArgumentDescription
onLinkActivateLinkActivateEventFired when the link is followed in the same tab, before the browser navigates. Cancel it to navigate with a router instead. It bubbles, is composed, and is cancelable. Its detail carries href, target, download, rel, altKey, ctrlKey, metaKey, shiftKey, and originalEvent.
onClickReact.MouseEvent<HTMLElement>Dispatched when the icon button is clicked. A disabled or soft-disabled one does not dispatch it. It bubbles, is composed, and is cancelable.

A click that a listener cancels with preventDefault() neither submits nor resets the form.

Parameters⁠

ParameterTypeDescription
Autofocusbool?default falseRequests focus for the icon button when the page loads, as the native Autofocus attribute does.
BadgeConcealedbool?default falseHides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges.
BadgeDotbool?default falseShows the badge as a small dot with no text, whether or not BadgeValue is set. See Badges.
BadgeValuestring?The badge's text. While it is empty and BadgeDot is not set, no badge renders. Ignored if BadgeDot is set. See Badges.
Disabledbool?default falseDisables the icon button: it leaves the Tab order and cannot be focused or activated. See Disabled and soft-disabled.
Downloadstring?Downloads the linked URL instead of navigating to it. A file name saves it under that name, and an empty string downloads it under the server's own name, like the bare HTML attribute. Unset, it navigates. Ignored unless Href is set.
FlipIconInRtlbool?default falseMirrors the IconName icon when the text direction is right to left. See Icons.
Hrefstring?The URL that the link icon button points to. When set, the icon button is a link: a screen reader announces it as one, and a click follows the URL instead of submitting or resetting its form. A disabled or soft-disabled link icon button cannot be followed. See Links.
IconNamestring?A Material Symbols icon name. This is an alternative to using the default slot. If both are provided, the slot takes precedence, and a warning is logged. See Icons.
Namestring?The name the element's value is submitted under with its form. See Forms.
OnNavigateEventCallback<LinkActivateEventArgs>Navigates for a link that points inside the app: the same base address, opening in the same tab. The browser's navigation is canceled first, and this callback replaces the NavigationManager.NavigateTo the component calls by default. It is not called for any other link.
Relstring?The link's relationship to the linked URL, as the anchor's Rel, used exactly as given. Unset, the anchor has no Rel. Ignored unless Href is set.
SizeSize?Size.ExtraSmall, .Small, .Medium, .Large, .ExtraLargedefault Size.Small, from the style configurationSets how large the component is, from extra-small to extra-large. A larger size makes it taller. See Size and width.
SoftDisabledbool?default falseDisables the icon button but keeps it focusable and in the Tab order. It carries aria-disabled="true", and a click on it does nothing and does not bubble past the button; a capture-phase listener still receives it. Use it when a disabled icon button must stay reachable by keyboard and screen reader. For when this is needed, see WAI-ARIA Authoring Practices: disabled controls. See Disabled and soft-disabled.
TargetUrlTarget?UrlTarget.Blank, .Self, .Parent, .Top, .Emptydefault UrlTarget.EmptyWhere a link icon button opens Href. It has no effect without Href. Empty, the link opens in the same tab. See Links.
Titlestring?The native tooltip the browser shows on hover. With no aria-label, it is also the icon button's accessible name, except on a link, which takes its name from aria-label only. See Tooltips, Links.
TooltipPositionTooltipPosition?TooltipPosition.StartStart, .StartCenter, .StartEnd, .CenterStart, .CenterEnd, .EndStart, .EndCenter, .EndEnddefault TooltipPosition.EndCenter, from the style configurationWhere the tooltip appears around the element, such as above or beside it. It has no effect without TooltipValue. See Tooltips.
TooltipValuestring?The tooltip's text. The tooltip opens on hover and on focus, and a screen reader announces it as the control's description unless it only repeats the control's name. No tooltip renders while it is empty. See Tooltips.
TouchTargetTouchTarget?TouchTarget.None, .Overflow, .Wrapperdefault TouchTarget.Overflow, from the style configurationThe area that takes a touch, at least 48 by 48 pixels and centered on the component. overflow extends it past the component without changing the component's layout size, wrapper makes the component take up the whole area in the layout, and none limits it to the component's own size. See Size and width.
TypeFormSubmitterBehavior?FormSubmitterBehavior.Button, .Reset, .Submitdefault FormSubmitterBehavior.SubmitWhat a click does to the icon button's form: submit submits it, reset resets it, and button does nothing. It has no effect on a link icon button or outside a form. See Forms, In a compact layout.
Valuestring?The value added to a form with the button's name when the button submits a form. See Forms.
VariantIconButtonVariant?IconButtonVariant.Filled, .Outlined, .Standard, .Tonaldefault IconButtonVariant.Filled, from the style configurationSets how strongly the icon button stands out from its surroundings. See Variants.
WidthIconButtonWidth?IconButtonWidth.Narrow, .Regular, .Widedefault IconButtonWidth.Regular, from the style configurationSets how wide the icon button is, without changing the size of its icon. A wider button stands out more. See Size and width.

With href set, the icon button is a link and takes no part in its form: type, name, and value are ignored.

Render fragments⁠

ParameterTypeDescription
ChildContentRenderFragment?The icon: a CbIcon or an inline svg. It overrides IconName, and the icon button logs a warning when both are set. Text alone renders nothing.

Event callbacks⁠

ParameterTypeDescription
OnLinkActivateEventCallback<LinkActivateEventArgs>Fired when the link is followed in the same tab, before the browser navigates. Cancel it to navigate with a router instead. It bubbles, is composed, and is cancelable. Its detail carries Href, Target, Download, Rel, altKey, ctrlKey, metaKey, shiftKey, and originalEvent.
OnClickEventCallback<MouseEventArgs>Dispatched when the icon button is clicked. A disabled or soft-disabled one does not dispatch it. It bubbles, is composed, and is cancelable.

A click that a listener cancels with preventDefault() neither submits nor resets the form.

Inputs⁠

InputTypeDescription
autofocusbooleandefault falseRequests focus for the icon button when the page loads, as the native autofocus attribute does.
badgeConcealedbooleandefault falseHides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges.
badgeDotbooleandefault falseShows the badge as a small dot with no text, whether or not badgeValue is set. See Badges.
badgeValuestringThe badge's text. While it is empty and badgeDot is not set, no badge renders. Ignored if badgeDot is set. See Badges.
disabledbooleandefault falseDisables the icon button: it leaves the Tab order and cannot be focused or activated. See Disabled and soft-disabled.
downloadstringDownloads the linked URL instead of navigating to it. A file name saves it under that name, and an empty string downloads it under the server's own name, like the bare HTML attribute. Unset, it navigates. Ignored unless href is set.
flipIconInRtlbooleandefault falseMirrors the iconName icon when the text direction is right to left. See Icons.
hrefstringThe URL that the link icon button points to. When set, the icon button is a link: a screen reader announces it as one, and a click follows the URL instead of submitting or resetting its form. A disabled or soft-disabled link icon button cannot be followed. See Links.
iconNamestringA Material Symbols icon name. This is an alternative to using the default slot. If both are provided, the slot takes precedence, and a warning is logged. See Icons.
namestringThe name the element's value is submitted under with its form. See Forms.
relstringThe link's relationship to the linked URL, as the anchor's rel, used exactly as given. Unset, the anchor has no rel. Ignored unless href is set.
sizeSizeTypeSize.ExtraSmall, .Small, .Medium, .Large, .ExtraLargedefault Size.Small, from the style configurationSets how large the component is, from extra-small to extra-large. A larger size makes it taller. See Size and width.
softDisabledbooleandefault falseDisables the icon button but keeps it focusable and in the Tab order. It carries aria-disabled="true", and a click on it does nothing and does not bubble past the button; a capture-phase listener still receives it. Use it when a disabled icon button must stay reachable by keyboard and screen reader. For when this is needed, see WAI-ARIA Authoring Practices: disabled controls. See Disabled and soft-disabled.
targetUrlTargetTypeUrlTarget.Blank, .Self, .Parent, .Top, .Emptydefault UrlTarget.EmptyWhere a link icon button opens href. It has no effect without href. Empty, the link opens in the same tab. See Links.
titlestringThe native tooltip the browser shows on hover. With no aria-label, it is also the icon button's accessible name, except on a link, which takes its name from aria-label only. See Tooltips, Links.
tooltipPositionTooltipPositionTypeTooltipPosition.StartStart, .StartCenter, .StartEnd, .CenterStart, .CenterEnd, .EndStart, .EndCenter, .EndEnddefault TooltipPosition.EndCenter, from the style configurationWhere the tooltip appears around the element, such as above or beside it. It has no effect without tooltipValue. See Tooltips.
tooltipValuestringThe tooltip's text. The tooltip opens on hover and on focus, and a screen reader announces it as the control's description unless it only repeats the control's name. No tooltip renders while it is empty. See Tooltips.
touchTargetTouchTargetTypeTouchTarget.None, .Overflow, .Wrapperdefault TouchTarget.Overflow, from the style configurationThe area that takes a touch, at least 48 by 48 pixels and centered on the component. overflow extends it past the component without changing the component's layout size, wrapper makes the component take up the whole area in the layout, and none limits it to the component's own size. See Size and width.
typeFormSubmitterBehaviorTypeFormSubmitterBehavior.Button, .Reset, .Submitdefault FormSubmitterBehavior.SubmitWhat a click does to the icon button's form: submit submits it, reset resets it, and button does nothing. It has no effect on a link icon button or outside a form. See Forms, In a compact layout.
valuestringThe value added to a form with the button's name when the button submits a form. See Forms.
variantIconButtonVariantTypeIconButtonVariant.Filled, .Outlined, .Standard, .Tonaldefault IconButtonVariant.Filled, from the style configurationSets how strongly the icon button stands out from its surroundings. See Variants.
widthIconButtonWidthTypeIconButtonWidth.Narrow, .Regular, .Widedefault IconButtonWidth.Regular, from the style configurationSets how wide the icon button is, without changing the size of its icon. A wider button stands out more. See Size and width.

With href set, the icon button is a link and takes no part in its form: type, name, and value are ignored.

Content projection⁠

ContentDescription
content with no slotThe icon: a CaIcon or an inline svg. It overrides iconName, and the icon button logs a warning when both are set. Text alone renders nothing.

Outputs⁠

OutputEventDescription
cwLinkActivateLinkActivateEventFired when the link is followed in the same tab, before the browser navigates. Cancel it to navigate with a router instead. It bubbles, is composed, and is cancelable. Its detail carries href, target, download, rel, altKey, ctrlKey, metaKey, shiftKey, and originalEvent.
cwClickMouseEventDispatched when the icon button is clicked. A disabled or soft-disabled one does not dispatch it. It bubbles, is composed, and is cancelable.

A click that a listener cancels with preventDefault() neither submits nor resets the form.

Props⁠

PropTypeDescription
autofocusbooleandefault falseRequests focus for the icon button when the page loads, as the native autofocus attribute does.
badgeConcealedbooleandefault falseHides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges.
badgeDotbooleandefault falseShows the badge as a small dot with no text, whether or not badgeValue is set. See Badges.
badgeValuestringThe badge's text. While it is empty and badgeDot is not set, no badge renders. Ignored if badgeDot is set. See Badges.
disabledbooleandefault falseDisables the icon button: it leaves the Tab order and cannot be focused or activated. See Disabled and soft-disabled.
downloadstringDownloads the linked URL instead of navigating to it. A file name saves it under that name, and an empty string downloads it under the server's own name, like the bare HTML attribute. Unset, it navigates. Ignored unless href is set.
flipIconInRtlbooleandefault falseMirrors the iconName icon when the text direction is right to left. See Icons.
hrefstringThe URL that the link icon button points to. When set, the icon button is a link: a screen reader announces it as one, and a click follows the URL instead of submitting or resetting its form. A disabled or soft-disabled link icon button cannot be followed. See Links.
iconNamestringA Material Symbols icon name. This is an alternative to using the default slot. If both are provided, the slot takes precedence, and a warning is logged. See Icons.
namestringThe name the element's value is submitted under with its form. See Forms.
relstringThe link's relationship to the linked URL, as the anchor's rel, used exactly as given. Unset, the anchor has no rel. Ignored unless href is set.
sizeSizeTypeSize.ExtraSmall, .Small, .Medium, .Large, .ExtraLargedefault Size.Small, from the style configurationSets how large the component is, from extra-small to extra-large. A larger size makes it taller. See Size and width.
softDisabledbooleandefault falseDisables the icon button but keeps it focusable and in the Tab order. It carries aria-disabled="true", and a click on it does nothing and does not bubble past the button; a capture-phase listener still receives it. Use it when a disabled icon button must stay reachable by keyboard and screen reader. For when this is needed, see WAI-ARIA Authoring Practices: disabled controls. See Disabled and soft-disabled.
targetUrlTargetTypeUrlTarget.Blank, .Self, .Parent, .Top, .Emptydefault UrlTarget.EmptyWhere a link icon button opens href. It has no effect without href. Empty, the link opens in the same tab. See Links.
titlestringThe native tooltip the browser shows on hover. With no aria-label, it is also the icon button's accessible name, except on a link, which takes its name from aria-label only. See Tooltips, Links.
tooltipPositionTooltipPositionTypeTooltipPosition.StartStart, .StartCenter, .StartEnd, .CenterStart, .CenterEnd, .EndStart, .EndCenter, .EndEnddefault TooltipPosition.EndCenter, from the style configurationWhere the tooltip appears around the element, such as above or beside it. It has no effect without tooltipValue. See Tooltips.
tooltipValuestringThe tooltip's text. The tooltip opens on hover and on focus, and a screen reader announces it as the control's description unless it only repeats the control's name. No tooltip renders while it is empty. See Tooltips.
touchTargetTouchTargetTypeTouchTarget.None, .Overflow, .Wrapperdefault TouchTarget.Overflow, from the style configurationThe area that takes a touch, at least 48 by 48 pixels and centered on the component. overflow extends it past the component without changing the component's layout size, wrapper makes the component take up the whole area in the layout, and none limits it to the component's own size. See Size and width.
typeFormSubmitterBehaviorTypeFormSubmitterBehavior.Button, .Reset, .Submitdefault FormSubmitterBehavior.SubmitWhat a click does to the icon button's form: submit submits it, reset resets it, and button does nothing. It has no effect on a link icon button or outside a form. See Forms, In a compact layout.
valuestringThe value added to a form with the button's name when the button submits a form. See Forms.
variantIconButtonVariantTypeIconButtonVariant.Filled, .Outlined, .Standard, .Tonaldefault IconButtonVariant.Filled, from the style configurationSets how strongly the icon button stands out from its surroundings. See Variants.
widthIconButtonWidthTypeIconButtonWidth.Narrow, .Regular, .Widedefault IconButtonWidth.Regular, from the style configurationSets how wide the icon button is, without changing the size of its icon. A wider button stands out more. See Size and width.

With href set, the icon button is a link and takes no part in its form: type, name, and value are ignored.

Slots⁠

SlotDescription
defaultThe icon: a CvIcon or an inline svg. It overrides iconName, and the icon button logs a warning when both are set. Text alone renders nothing.

Events⁠

EventTypeDescription
linkActivateLinkActivateEventFired when the link is followed in the same tab, before the browser navigates. Cancel it to navigate with a router instead. It bubbles, is composed, and is cancelable. Its detail carries href, target, download, rel, altKey, ctrlKey, metaKey, shiftKey, and originalEvent.
clickMouseEventDispatched when the icon button is clicked. A disabled or soft-disabled one does not dispatch it. It bubbles, is composed, and is cancelable.

A click that a listener cancels with preventDefault() neither submits nor resets the form.

Props⁠

PropTypeDescription
autofocusbooleandefault falseRequests focus for the icon button when the page loads, as the native autofocus attribute does.
badgeConcealedbooleandefault falseHides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges.
badgeDotbooleandefault falseShows the badge as a small dot with no text, whether or not badgeValue is set. See Badges.
badgeValuestringThe badge's text. While it is empty and badgeDot is not set, no badge renders. Ignored if badgeDot is set. See Badges.
disabledbooleandefault falseDisables the icon button: it leaves the Tab order and cannot be focused or activated. See Disabled and soft-disabled.
downloadstringDownloads the linked URL instead of navigating to it. A file name saves it under that name, and an empty string downloads it under the server's own name, like the bare HTML attribute. Unset, it navigates. Ignored unless href is set.
flipIconInRtlbooleandefault falseMirrors the iconName icon when the text direction is right to left. See Icons.
hrefstringThe URL that the link icon button points to. When set, the icon button is a link: a screen reader announces it as one, and a click follows the URL instead of submitting or resetting its form. A disabled or soft-disabled link icon button cannot be followed. See Links.
iconNamestringA Material Symbols icon name. This is an alternative to using the default slot. If both are provided, the slot takes precedence, and a warning is logged. See Icons.
namestringThe name the element's value is submitted under with its form. See Forms.
relstringThe link's relationship to the linked URL, as the anchor's rel, used exactly as given. Unset, the anchor has no rel. Ignored unless href is set.
sizeSizeTypeSize.ExtraSmall, .Small, .Medium, .Large, .ExtraLargedefault Size.Small, from the style configurationSets how large the component is, from extra-small to extra-large. A larger size makes it taller. See Size and width.
softDisabledbooleandefault falseDisables the icon button but keeps it focusable and in the Tab order. It carries aria-disabled="true", and a click on it does nothing and does not bubble past the button; a capture-phase listener still receives it. Use it when a disabled icon button must stay reachable by keyboard and screen reader. For when this is needed, see WAI-ARIA Authoring Practices: disabled controls. See Disabled and soft-disabled.
targetUrlTargetTypeUrlTarget.Blank, .Self, .Parent, .Top, .Emptydefault UrlTarget.EmptyWhere a link icon button opens href. It has no effect without href. Empty, the link opens in the same tab. See Links.
titlestringThe native tooltip the browser shows on hover. With no aria-label, it is also the icon button's accessible name, except on a link, which takes its name from aria-label only. See Tooltips, Links.
tooltipPositionTooltipPositionTypeTooltipPosition.StartStart, .StartCenter, .StartEnd, .CenterStart, .CenterEnd, .EndStart, .EndCenter, .EndEnddefault TooltipPosition.EndCenter, from the style configurationWhere the tooltip appears around the element, such as above or beside it. It has no effect without tooltipValue. See Tooltips.
tooltipValuestringThe tooltip's text. The tooltip opens on hover and on focus, and a screen reader announces it as the control's description unless it only repeats the control's name. No tooltip renders while it is empty. See Tooltips.
touchTargetTouchTargetTypeTouchTarget.None, .Overflow, .Wrapperdefault TouchTarget.Overflow, from the style configurationThe area that takes a touch, at least 48 by 48 pixels and centered on the component. overflow extends it past the component without changing the component's layout size, wrapper makes the component take up the whole area in the layout, and none limits it to the component's own size. See Size and width.
typeFormSubmitterBehaviorTypeFormSubmitterBehavior.Button, .Reset, .Submitdefault FormSubmitterBehavior.SubmitWhat a click does to the icon button's form: submit submits it, reset resets it, and button does nothing. It has no effect on a link icon button or outside a form. See Forms, In a compact layout.
valuestringThe value added to a form with the button's name when the button submits a form. See Forms.
variantIconButtonVariantTypeIconButtonVariant.Filled, .Outlined, .Standard, .Tonaldefault IconButtonVariant.Filled, from the style configurationSets how strongly the icon button stands out from its surroundings. See Variants.
widthIconButtonWidthTypeIconButtonWidth.Narrow, .Regular, .Widedefault IconButtonWidth.Regular, from the style configurationSets how wide the icon button is, without changing the size of its icon. A wider button stands out more. See Size and width.

With href set, the icon button is a link and takes no part in its form: type, name, and value are ignored.

Snippets⁠

SnippetDescription
childrenThe icon: a CsIcon or an inline svg. It overrides iconName, and the icon button logs a warning when both are set. Text alone renders nothing.

Events⁠

PropTypeDescription
onLinkActivateLinkActivateEventFired when the link is followed in the same tab, before the browser navigates. Cancel it to navigate with a router instead. It bubbles, is composed, and is cancelable. Its detail carries href, target, download, rel, altKey, ctrlKey, metaKey, shiftKey, and originalEvent.
onClickMouseEventDispatched when the icon button is clicked. A disabled or soft-disabled one does not dispatch it. It bubbles, is composed, and is cancelable.

A click that a listener cancels with preventDefault() neither submits nor resets the form.

Each attribute value has its own tokens; a cell shows its token's value, and selecting the cell shows the token's fallback path, with each name and value ready to copy. For example, the filled column's container-color row is --ct-icon-button-filled-container-color, which defaults to --ct-sys-color-primary.

Variant⁠

Namefilledoutlinedstandardtonal
container-color--ct-sys-color-primary --ct-icon-button-filled-container-colortransparent --ct-icon-button-outlined-container-colortransparent --ct-icon-button-standard-container-color--ct-sys-color-secondary-container --ct-icon-button-tonal-container-color
icon-color--ct-sys-color-on-primary --ct-icon-button-filled-icon-color--ct-sys-color-on-surface-variant --ct-icon-button-outlined-icon-color--ct-sys-color-on-surface-variant --ct-icon-button-standard-icon-color--ct-sys-color-on-secondary-container --ct-icon-button-tonal-icon-color
outline-colortransparent --ct-icon-button-filled-outline-color--ct-sys-color-outline-variant --ct-icon-button-outlined-outline-colortransparent --ct-icon-button-standard-outline-colortransparent --ct-icon-button-tonal-outline-color
state-layer-color--ct-sys-color-on-primary --ct-icon-button-filled-state-layer-colorsame as icon-color --ct-icon-button-outlined-state-layer-color--ct-sys-color-on-surface-variant --ct-icon-button-standard-state-layer-color--ct-sys-color-on-secondary-container --ct-icon-button-tonal-state-layer-color
disabled-container-color--ct-sys-color-on-surface --ct-icon-button-filled-disabled-container-colortransparent --ct-icon-button-outlined-disabled-container-colortransparent --ct-icon-button-standard-disabled-container-color--ct-sys-color-on-surface --ct-icon-button-tonal-disabled-container-color
disabled-container-opacity0.1 --ct-icon-button-filled-disabled-container-opacity0.1 --ct-icon-button-outlined-disabled-container-opacity0.1 --ct-icon-button-standard-disabled-container-opacity0.1 --ct-icon-button-tonal-disabled-container-opacity
disabled-icon-color--ct-sys-color-on-surface --ct-icon-button-filled-disabled-icon-color--ct-sys-color-on-surface --ct-icon-button-outlined-disabled-icon-color--ct-sys-color-on-surface --ct-icon-button-standard-disabled-icon-color--ct-sys-color-on-surface --ct-icon-button-tonal-disabled-icon-color
disabled-icon-opacity0.38 --ct-icon-button-filled-disabled-icon-opacity0.38 --ct-icon-button-outlined-disabled-icon-opacity0.38 --ct-icon-button-standard-disabled-icon-opacity0.38 --ct-icon-button-tonal-disabled-icon-opacity
disabled-outline-color--ct-sys-color-outline-variant --ct-icon-button-filled-disabled-outline-color--ct-sys-color-outline-variant --ct-icon-button-outlined-disabled-outline-color--ct-sys-color-outline-variant --ct-icon-button-standard-disabled-outline-color--ct-sys-color-outline-variant --ct-icon-button-tonal-disabled-outline-color
disabled-outline-opacity0.38 --ct-icon-button-filled-disabled-outline-opacity0.38 --ct-icon-button-outlined-disabled-outline-opacity0.38 --ct-icon-button-standard-disabled-outline-opacity0.38 --ct-icon-button-tonal-disabled-outline-opacity
focus-icon-colorsame as icon-color --ct-icon-button-filled-focus-icon-colorsame as icon-color --ct-icon-button-outlined-focus-icon-colorsame as icon-color --ct-icon-button-standard-focus-icon-colorsame as icon-color --ct-icon-button-tonal-focus-icon-color
focus-outline-colorsame as outline-color --ct-icon-button-filled-focus-outline-color--ct-sys-color-outline-variant --ct-icon-button-outlined-focus-outline-colorsame as outline-color --ct-icon-button-standard-focus-outline-colorsame as outline-color --ct-icon-button-tonal-focus-outline-color
hover-icon-colorsame as icon-color --ct-icon-button-filled-hover-icon-colorsame as icon-color --ct-icon-button-outlined-hover-icon-colorsame as icon-color --ct-icon-button-standard-hover-icon-colorsame as icon-color --ct-icon-button-tonal-hover-icon-color
hover-outline-colorsame as outline-color --ct-icon-button-filled-hover-outline-color--ct-sys-color-outline-variant --ct-icon-button-outlined-hover-outline-colorsame as outline-color --ct-icon-button-standard-hover-outline-colorsame as outline-color --ct-icon-button-tonal-hover-outline-color
hover-state-layer-colorsame as state-layer-color --ct-icon-button-filled-hover-state-layer-colorsame as state-layer-color --ct-icon-button-outlined-hover-state-layer-colorsame as state-layer-color --ct-icon-button-standard-hover-state-layer-colorsame as state-layer-color --ct-icon-button-tonal-hover-state-layer-color
hover-state-layer-opacity--ct-sys-state-hover-state-layer-opacity --ct-icon-button-filled-hover-state-layer-opacity--ct-sys-state-hover-state-layer-opacity --ct-icon-button-outlined-hover-state-layer-opacity--ct-sys-state-hover-state-layer-opacity --ct-icon-button-standard-hover-state-layer-opacity--ct-sys-state-hover-state-layer-opacity --ct-icon-button-tonal-hover-state-layer-opacity
pressed-icon-colorsame as icon-color --ct-icon-button-filled-pressed-icon-colorsame as icon-color --ct-icon-button-outlined-pressed-icon-colorsame as icon-color --ct-icon-button-standard-pressed-icon-colorsame as icon-color --ct-icon-button-tonal-pressed-icon-color
pressed-outline-colorsame as outline-color --ct-icon-button-filled-pressed-outline-color--ct-sys-color-outline-variant --ct-icon-button-outlined-pressed-outline-colorsame as outline-color --ct-icon-button-standard-pressed-outline-colorsame as outline-color --ct-icon-button-tonal-pressed-outline-color
pressed-state-layer-colorsame as state-layer-color --ct-icon-button-filled-pressed-state-layer-colorsame as state-layer-color --ct-icon-button-outlined-pressed-state-layer-colorsame as state-layer-color --ct-icon-button-standard-pressed-state-layer-colorsame as state-layer-color --ct-icon-button-tonal-pressed-state-layer-color
pressed-state-layer-opacity--ct-sys-state-pressed-state-layer-opacity --ct-icon-button-filled-pressed-state-layer-opacity--ct-sys-state-pressed-state-layer-opacity --ct-icon-button-outlined-pressed-state-layer-opacity--ct-sys-state-pressed-state-layer-opacity --ct-icon-button-standard-pressed-state-layer-opacity--ct-sys-state-pressed-state-layer-opacity --ct-icon-button-tonal-pressed-state-layer-opacity
large-outline-width0px --ct-icon-button-filled-large-outline-width2px --ct-icon-button-outlined-large-outline-width0px --ct-icon-button-standard-large-outline-width0px --ct-icon-button-tonal-large-outline-width
medium-outline-width0px --ct-icon-button-filled-medium-outline-width1px --ct-icon-button-outlined-medium-outline-width0px --ct-icon-button-standard-medium-outline-width0px --ct-icon-button-tonal-medium-outline-width
small-outline-width0px --ct-icon-button-filled-small-outline-width1px --ct-icon-button-outlined-small-outline-width0px --ct-icon-button-standard-small-outline-width0px --ct-icon-button-tonal-small-outline-width
xlarge-outline-width0px --ct-icon-button-filled-xlarge-outline-width3px --ct-icon-button-outlined-xlarge-outline-width0px --ct-icon-button-standard-xlarge-outline-width0px --ct-icon-button-tonal-xlarge-outline-width
xsmall-outline-width0px --ct-icon-button-filled-xsmall-outline-width1px --ct-icon-button-outlined-xsmall-outline-width0px --ct-icon-button-standard-xsmall-outline-width0px --ct-icon-button-tonal-xsmall-outline-width

Size⁠

Token names spell extra-small as xsmall and extra-large as xlarge.

Nameextra-smallsmallmediumlargeextra-large
container-height32px --ct-icon-button-xsmall-container-height40px --ct-icon-button-small-container-height56px --ct-icon-button-medium-container-height96px --ct-icon-button-large-container-height136px --ct-icon-button-xlarge-container-height
corner-end-end-radiussame as corner-radius --ct-icon-button-xsmall-corner-end-end-radiussame as corner-radius --ct-icon-button-small-corner-end-end-radiussame as corner-radius --ct-icon-button-medium-corner-end-end-radiussame as corner-radius --ct-icon-button-large-corner-end-end-radiussame as corner-radius --ct-icon-button-xlarge-corner-end-end-radius
corner-end-start-radiussame as corner-radius --ct-icon-button-xsmall-corner-end-start-radiussame as corner-radius --ct-icon-button-small-corner-end-start-radiussame as corner-radius --ct-icon-button-medium-corner-end-start-radiussame as corner-radius --ct-icon-button-large-corner-end-start-radiussame as corner-radius --ct-icon-button-xlarge-corner-end-start-radius
corner-radius--ct-sys-corner-radius-full --ct-icon-button-xsmall-corner-radius--ct-sys-corner-radius-full --ct-icon-button-small-corner-radius--ct-sys-corner-radius-full --ct-icon-button-medium-corner-radius--ct-sys-corner-radius-full --ct-icon-button-large-corner-radius--ct-sys-corner-radius-full --ct-icon-button-xlarge-corner-radius
corner-start-end-radiussame as corner-radius --ct-icon-button-xsmall-corner-start-end-radiussame as corner-radius --ct-icon-button-small-corner-start-end-radiussame as corner-radius --ct-icon-button-medium-corner-start-end-radiussame as corner-radius --ct-icon-button-large-corner-start-end-radiussame as corner-radius --ct-icon-button-xlarge-corner-start-end-radius
corner-start-start-radiussame as corner-radius --ct-icon-button-xsmall-corner-start-start-radiussame as corner-radius --ct-icon-button-small-corner-start-start-radiussame as corner-radius --ct-icon-button-medium-corner-start-start-radiussame as corner-radius --ct-icon-button-large-corner-start-start-radiussame as corner-radius --ct-icon-button-xlarge-corner-start-start-radius
icon-size20px --ct-icon-button-xsmall-icon-size24px --ct-icon-button-small-icon-size24px --ct-icon-button-medium-icon-size32px --ct-icon-button-large-icon-size40px --ct-icon-button-xlarge-icon-size
pressed-corner-end-end-radiussame as pressed-corner-radius --ct-icon-button-xsmall-pressed-corner-end-end-radiussame as pressed-corner-radius --ct-icon-button-small-pressed-corner-end-end-radiussame as pressed-corner-radius --ct-icon-button-medium-pressed-corner-end-end-radiussame as pressed-corner-radius --ct-icon-button-large-pressed-corner-end-end-radiussame as pressed-corner-radius --ct-icon-button-xlarge-pressed-corner-end-end-radius
pressed-corner-end-start-radiussame as pressed-corner-radius --ct-icon-button-xsmall-pressed-corner-end-start-radiussame as pressed-corner-radius --ct-icon-button-small-pressed-corner-end-start-radiussame as pressed-corner-radius --ct-icon-button-medium-pressed-corner-end-start-radiussame as pressed-corner-radius --ct-icon-button-large-pressed-corner-end-start-radiussame as pressed-corner-radius --ct-icon-button-xlarge-pressed-corner-end-start-radius
pressed-corner-radius--ct-sys-corner-radius-small --ct-icon-button-xsmall-pressed-corner-radius--ct-sys-corner-radius-small --ct-icon-button-small-pressed-corner-radius--ct-sys-corner-radius-medium --ct-icon-button-medium-pressed-corner-radius--ct-sys-corner-radius-large --ct-icon-button-large-pressed-corner-radius--ct-sys-corner-radius-large --ct-icon-button-xlarge-pressed-corner-radius
pressed-corner-start-end-radiussame as pressed-corner-radius --ct-icon-button-xsmall-pressed-corner-start-end-radiussame as pressed-corner-radius --ct-icon-button-small-pressed-corner-start-end-radiussame as pressed-corner-radius --ct-icon-button-medium-pressed-corner-start-end-radiussame as pressed-corner-radius --ct-icon-button-large-pressed-corner-start-end-radiussame as pressed-corner-radius --ct-icon-button-xlarge-pressed-corner-start-end-radius
pressed-corner-start-start-radiussame as pressed-corner-radius --ct-icon-button-xsmall-pressed-corner-start-start-radiussame as pressed-corner-radius --ct-icon-button-small-pressed-corner-start-start-radiussame as pressed-corner-radius --ct-icon-button-medium-pressed-corner-start-start-radiussame as pressed-corner-radius --ct-icon-button-large-pressed-corner-start-start-radiussame as pressed-corner-radius --ct-icon-button-xlarge-pressed-corner-start-start-radius
narrow-leading-space4px --ct-icon-button-xsmall-narrow-leading-space4px --ct-icon-button-small-narrow-leading-space12px --ct-icon-button-medium-narrow-leading-space16px --ct-icon-button-large-narrow-leading-space32px --ct-icon-button-xlarge-narrow-leading-space
narrow-trailing-space4px --ct-icon-button-xsmall-narrow-trailing-space4px --ct-icon-button-small-narrow-trailing-space12px --ct-icon-button-medium-narrow-trailing-space16px --ct-icon-button-large-narrow-trailing-space32px --ct-icon-button-xlarge-narrow-trailing-space
regular-leading-space6px --ct-icon-button-xsmall-regular-leading-space8px --ct-icon-button-small-regular-leading-space16px --ct-icon-button-medium-regular-leading-space32px --ct-icon-button-large-regular-leading-space48px --ct-icon-button-xlarge-regular-leading-space
regular-trailing-space6px --ct-icon-button-xsmall-regular-trailing-space8px --ct-icon-button-small-regular-trailing-space16px --ct-icon-button-medium-regular-trailing-space32px --ct-icon-button-large-regular-trailing-space48px --ct-icon-button-xlarge-regular-trailing-space
wide-leading-space10px --ct-icon-button-xsmall-wide-leading-space14px --ct-icon-button-small-wide-leading-space24px --ct-icon-button-medium-wide-leading-space48px --ct-icon-button-large-wide-leading-space72px --ct-icon-button-xlarge-wide-leading-space
wide-trailing-space10px --ct-icon-button-xsmall-wide-trailing-space14px --ct-icon-button-small-wide-trailing-space24px --ct-icon-button-medium-wide-trailing-space48px --ct-icon-button-large-wide-trailing-space72px --ct-icon-button-xlarge-wide-trailing-space

Other tokens⁠

These stay the same whatever the variant and size.

TokenValue
--ct-button-group-connected-container-shape--ct-sys-corner-radius-full --ct-button-group-connected-container-shape
--ct-button-group-connected-small-inner-corner--ct-sys-corner-radius-small --ct-button-group-connected-small-inner-corner
--ct-button-group-connected-small-pressed-inner-corner--ct-sys-corner-radius-extra-small --ct-button-group-connected-small-pressed-inner-corner
--ct-icon-button-icon-fill1 --ct-icon-button-icon-fill

Names and states⁠

An icon button follows the WAI-ARIA Authoring Practices: Button pattern; with href it is a link and follows the WAI-ARIA Authoring Practices: Link pattern.

  • An icon button has no accessible name of its own: a cw-icon is hidden from assistive technology, whether it comes from icon-name or the slot. Give every icon button an aria-label.
  • A slotted img or svg is not hidden. With no aria-label, its alt or <title> becomes the name.
  • title sets the browser's tooltip, and with no aria-label it is also the name. A link icon button takes its name from aria-label only.
  • On a button, only aria-label, aria-haspopup, and aria-expanded take effect. On a link icon button, only aria-label does. Any other ARIA attribute has no effect.
  • For an icon button that opens a menu, set aria-haspopup="menu"; keep aria-expanded in step with the menu. A disclosure takes aria-expanded alone.
  • soft-disabled makes a screen reader announce the icon button as unavailable, and a disabled or soft-disabled link icon button is still announced as a link, as unavailable, with no address.
  • The tooltip from tooltip-value is the icon button's description: a screen reader reads it after the name, and skips it when it only repeats the name. It never names the icon button.
  • An aria-label replaces the badge's count in the name. Put a count that matters into the aria-label too.
  • For an on/off setting, use a toggle icon button, which states its state with aria-pressed.

Keyboard and focus⁠

Key Action
Tab Moves focus to the icon button, then on to the next control.
Enter Activates the icon button, or follows the link.
Space Activates the icon button; a link icon button does not respond.
Escape Hides the tooltip, when the icon button has one.
  • A focus ring shows on keyboard focus only, and hides on pointer down.
  • disabled takes the icon button out of the Tab order, so keyboard focus never reaches it or its tooltip.
  • soft-disabled keeps it in the Tab order. Enter and Space still fire a click, which the component swallows; a listener registered in the capture phase still sees it.

Pointer and touch⁠

  • The touch target is at least 48 by 48 pixels by default, reaching past the visible button (overflow), so every size meets 2.5.8 Target Size (Minimum), which asks for 24 by 24.
  • wrapper keeps the same area and makes the icon button take it in the layout; none shrinks it to the visible button (Size and width).
  • A disabled or soft-disabled icon button still takes hover; a soft-disabled one swallows the click.

Display settings⁠

  • Forced colors: the container gets a 1px ButtonText border with its own corners, and a disabled one a dashed GrayText border. Hover and press draw a ButtonText border, 2px and 4px, in place of the overlays, and the focus ring is a solid CanvasText outline.
  • Reduced motion: the press ripple, the focus-ring animation, and the tooltip fade are skipped, and the corner change on press completes at once.
  • Right to left: only an icon-name icon with flip-icon-in-rtl mirrors. A slotted icon never does.

Standards⁠

With its defaults, an icon button meets seven WCAG 2.2 success criteria:

  • 2.1.1 Keyboard (A)
  • 2.1.2 No Keyboard Trap (A)
  • 2.5.2 Pointer Cancellation (A)
  • 2.4.7 Focus Visible (AA)
  • 2.5.8 Target Size (Minimum) (AA)
  • 1.3.1 Info and Relationships (A)
  • 1.4.13 Content on Hover or Focus (AA)

Five more depend on how you use it:

  • 4.1.2 Name, Role, Value (A): give every icon button an aria-label.
  • 2.5.3 Label in Name (A): keep the words a tooltip shows in the aria-label.
  • 2.4.6 Headings and Labels (AA): write an aria-label that says what the action does.
  • 1.1.1 Non-text Content (A): give a slotted image an alt, or name the icon button with aria-label and mark the image decorative.
  • 2.4.4 Link Purpose (In Context) (A): label a link icon button with where it goes.