HomeGetting StartedColor SystemTypographySpacingIconographyLayoutInstallationUsageAngularBlazorReactSvelteVueThemingTypographyCustomizationCSS-Only ComponentsFormsIconsIllustrationsAccessibilityGlobal ConfigurationTailwind CSSSass LibraryForge MCP ServerDropdown OptionsFocus Indicator ClippingAll componentsButtonButton AreaChipFloating Action ButtonIcon ButtonSplit ButtonAutocompleteButton ToggleCalendarCheckboxChip FieldColor PickerDate PickerDate Range PickerFile PickerLabelRadioSelectSliderSwitchText FieldTime PickerApp BarApp LauncherDrawerMenuPaginatorSkip LinkStepperTabsView SwitcherAccordionApp LayoutCardDividerExpansion PanelScaffoldSplit ViewStackStructured CardToolbarBadgeBannerBusy IndicatorCircular ProgressDialogInline MessageLinear ProgressPage StateSkeletonToastTooltipAvatarIconKeyLabel ValueListMeterSecretTableTimelineTimestampTreeKeyboard ShortcutPopoverIntroductionColorTypographySpacingShapeBorderElevationLayeringAnimationUsageIcon LibraryBlocksRoadmapChangelogBlog

Icon Button

Icon buttons are buttons that contain only an icon, and are used to represent actions or commands.

Overview

Icon buttons communicate actions using visual icons instead of text labels. They pair with tooltips which show the action name for clarity and should be placed close to the content they act on. Icon buttons are ideal for saving space while maintaining functionality.

Usage

forge-icon-button handles action emphasis through variant, theme, shape, and density, plus toggle, anchor, and badge support. Since there’s no visible label, always set an accessible name with aria-label and pair the button with a tooltip so its action is clear on hover or focus. Reach for a text button instead when the action isn’t widely recognizable from an icon alone.

Rules

Do
Use icon buttons for globally familiar, easily recognized actions (undo, edit, save, close).Always set an accessible label with aria-label, since the button has no visible text.Pair an icon button with a tooltip so its action is clear without relying on the icon alone.
Don't
Don't use when the icon meaning might be ambiguous to users.Don't use when actions require a detailed explanation that can't be conveyed through a simple icon and tooltip.Don't use an icon button for a domain-specific or unfamiliar action — use a text button instead.Don't mix icon buttons and text buttons within the same group or table row.

Variants

Pick the variant that matches the action’s emphasis, same as a text button: icon (the default, lowest emphasis) for most toolbar and row-level actions, outlined or tonal for secondary emphasis, filled for a stronger fill, and raised for the one primary action in a view.

The five icon button variants, ordered from lowest to highest emphasis.

Theme

Icon buttons default to a neutral theme. Set theme to a semantic or brand color to reinforce the action’s meaning.

Every theme available on an icon button.

Toggle

Set toggle for an icon button that represents a persistent on/off state — such as marking a favorite — and provide an on slot icon to swap in when pressed is true. Any icon can technically fill either slot, but the convention is an outlined-style icon for the default “off” state and a filled-style version of the same icon for the “on” slot, so the visual weight itself reinforces the state change.

A toggle icon button in each variant, swapping icons between its default and on slot.

Wrap an <a> inside a forge-icon-button to get a navigation link styled as an icon button.

An icon button that navigates. Note the anchor child.

With a badge

Pass a badge into the badge slot to overlay a count or dot indicator, most often for unread or new content.

A numeric badge overlaid on an icon button.

Loading

Swap in a forge-circular-progress in place of the icon to indicate a pending action.

A circular progress indicator replaces the icon while the action is pending.

Label aware

Wrap an icon button in a forge-label to give it a persistent, visible caption alongside its accessible label — useful when an icon alone may not be immediately familiar to every user.

A forge-label caption sits beneath the icon button.

Icon buttons are buttons that contain **only** an icon, and are used to represent actions or commands. Always provide an accessible label when using icon buttons.

import "@tylertech/forge/icon-button";
Properties
PropertyAttributeTypeDefaultDescription
toggletogglebooleanfalseGets/sets whether the icon button can be toggled.
pressedpressedbooleanfalseGets/sets whether the toggle button is pressed. Only applies when `toggle` is `true`.
ononunknownfalseAlias for `pressed` _(deprecated)_. Whether or not the toggle button is pressed. Only applies when `toggle` is `true`.
variantvariantIconButtonVariant"icon"Gets/sets the variant of the button. Valid values are `text`, `outlined`, `filled`, and `raised`.
themethemeIconButtonTheme"default"Gets/sets the theme of the button. Valid values are `text`, `outlined`, `filled`, and `raised`.
shapeshapeIconButtonShape"circular"Gets/sets the shape of the button. Valid values are `circular` and `squared`.
densitydensityIconButtonDensity"large"Gets/sets the density of the button. Valid values are `small`, `medium`, and `large`.
typetypeButtonType'button'Gets/sets the type of button.
disableddisabledbooleanfalseGets/sets whether the button is disabled.
densedensebooleanfalseGets/sets whether the button is dense.
popoverIconpopover-iconbooleanfalseGets/sets whether to show a popover icon.
namenamestring''Gets/sets the button name for form association.
valuevaluestring''Gets/sets the button value for form submission.
commandcommandCommandType''Indicates to the targeted element which action to take.
commandForcommand-forstring''Targets another element to be invoked.
commandForElement—HTMLElement | undefinedundefinedTargets another element to be invoked.
Events
NameTypeDescription
clickPointerEventFires when the button is clicked.
forge-icon-button-toggleCustomEvent<boolean>Fires when the icon button is toggled. Only applies in `toggle` mode.
Slots
NameDescription
(default)This is a default/unnamed slot for the icon.
onThe icon to show when in `toggle` mode when toggled "on".
startElements to logically render before the icon.
endElements to logically render after the icon.
badgeAbsolutely positions the element in the top-end corner of the button (typically reserved for badge-like content).
CSS Parts
NameDescription
::part(root)The root container element.
::part(focus-indicator)The focus-indicator indicator element.
::part(state-layer)The state-layer surface element.
CSS Custom Properties
NameDescription
--forge-icon-button-displayThe display property of the button.
--forge-icon-button-sizeThe height and min-width of the button.
--forge-icon-button-gapThe gap between the icon content.
--forge-icon-button-icon-colorThe color of the icon.
--forge-icon-button-background-colorThe background color of the button.
--forge-icon-button-icon-sizeThe size of the icon.
--forge-icon-button-cursorThe cursor of the button.
--forge-icon-button-paddingThe inline padding of the button.
--forge-icon-button-borderThe border of the button.
--forge-icon-button-shadowThe shadow of the button.
--forge-icon-button-transition-durationThe transition duration of the button.
--forge-icon-button-transition-timingThe transition timing of the button.
--forge-icon-button-shapeThe shape of the button.
--forge-icon-button-shape-start-startThe start-start border-radius of the button.
--forge-icon-button-shape-start-endThe start-end border-radius of the button.
--forge-icon-button-shape-end-startThe end-start border-radius of the button.
--forge-icon-button-shape-end-endThe end-end border-radius of the button.
--forge-icon-button-shape-squaredThe squared border-radius of the button.
--forge-icon-button-outlined-border-widthThe border width when in the outlined variant.
--forge-icon-button-outlined-border-styleThe border style when in the outlined variant.
--forge-icon-button-outlined-border-colorThe border color when in the outlined variant.
--forge-icon-button-tonal-icon-colorThe icon color when in the tonal variant.
--forge-icon-button-tonal-background-colorThe background color when in the tonal variant.
--forge-icon-button-filled-icon-colorThe icon color when in the filled variant.
--forge-icon-button-filled-background-colorThe background color when in the filled variant.
--forge-icon-button-raised-shadowThe shadow when in the raised variant.
--forge-icon-button-raised-hover-shadowThe shadow when in the raised variant and hovered.
--forge-icon-button-raised-active-shadowThe shadow when in the raised variant and active.
--forge-icon-button-raised-disabled-shadowThe shadow when in the raised variant and disabled.
--forge-icon-button-density-small-sizeThe size of the button when in the small density.
--forge-icon-button-density-small-paddingThe padding of the button when in the small density.
--forge-icon-button-density-small-icon-sizeThe size of the icon when in the small density.
--forge-icon-button-density-medium-sizeThe size of the button when in the medium density.
--forge-icon-button-density-medium-paddingThe padding of the button when in the medium density.
--forge-icon-button-density-large-sizeThe size of the button when in the large density.
--forge-icon-button-toggle-on-background-colorThe background color of the when in toggle mode and toggled on.
--forge-icon-button-toggle-on-icon-colorThe color of the icon when in toggle mode and toggled on.
--forge-icon-button-outlined-toggle-on-background-colorThe background color when in the outlined variant and toggled on.
--forge-icon-button-outlined-toggle-on-icon-colorThe icon color when in the outlined variant and toggled on.
--forge-icon-button-tonal-toggle-background-colorThe background color when in the tonal variant and toggled.
--forge-icon-button-tonal-toggle-on-background-colorThe background color when in the tonal variant and toggled on.
--forge-icon-button-tonal-toggle-on-icon-colorThe icon color when in the tonal variant and toggled on.
--forge-icon-button-filled-toggle-background-colorThe background color when in the filled variant and toggled.
--forge-icon-button-filled-toggle-icon-colorThe icon color when in the filled variant and toggled.
--forge-icon-button-filled-toggle-on-background-colorThe background color when in the filled variant and toggled on.
--forge-icon-button-filled-toggle-on-icon-colorThe icon color when in the filled variant and toggled on.
--forge-icon-button-disabled-cursorThe cursor when the button is disabled.
--forge-icon-button-disabled-opacityThe opacity when the button is disabled.
--forge-icon-button-popover-icon-paddingThe padding of the popover icon.
--forge-icon-button-focus-indicator-colorThe color of the focus indicator.
Methods
NameReturnsDescription
click()void
focus(options)void

Labeling and keyboard activation

  • Make sure every icon button can be reached by keyboard navigation, with a visible focus cue.
  • Give it an aria-label or aria-labelledby describing its purpose — an icon alone isn’t enough for assistive technology.
  • Pressing Space or Enter while an icon button is focused should activate it the same way a mouse click would.
  • If color is used to convey state (like a toggled-on state), pair it with an additional cue for users with color perception deficiencies.
Loading Forge chat…