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

Button Toggle

Button toggles allow users to select from a group of choices with single or multiple selection.

DayWeekMonth

Overview

Button toggle is a selection component that groups related options into a unified control, allowing users to choose one option from a set of alternatives. It functions similarly to radio buttons but with a more prominent visual treatment that emphasizes the available choices and current selection state.

Button toggles are commonly used for switching between different views of the same information or selecting from a small set of related options where the choices need to be immediately visible and easily comparable.

Usage

forge-button-toggle-group groups forge-button-toggle children into one bordered control, enforcing a single selection by default or several when multiple is set, through outlined, vertical, stretch, dense, and theme — plus native form participation via name and required. Use it for a small, always-visible set of options; reach for a radio group when each option needs a fully written-out label, or a select instead once there are more than a handful of options.

Rules

Do
Limit a button toggle group to a small, glanceable set of options.Pair every icon-only button toggle with an aria-label.Use multiple only when more than one option can be true at once, like text formatting.
Don't
Don't use a button toggle group for more than a handful of options — use a select instead.Don't rely on icons alone without an accessible label on each button toggle.Don't mix single- and multi-select semantics within the same group.

Selection

A button toggle group enforces a single selection by default — choosing one option deselects any other. Set multiple when more than one option can be true at once, such as a text-formatting toolbar.

Single selection

Only one button toggle in the group is active at a time.

Outline

outlined is on by default, drawing a border around the group; set it to false for a borderless button toggle group.

Outlined (default) compared to no-outline.

With icons

Slot a forge-icon inside a button toggle to pair its label with a leading icon.

A leading icon reinforces each option's label.

Dense and vertical

Pair dense with vertical for a compact, stacked button toggle group.

A dense, vertical button toggle group.

Button toggles allow users to select from a group of choices with single or multiple selection.

import "@tylertech/forge/button-toggle";
Properties
PropertyAttributeTypeDefaultDescription
valuevalueunknown—The value of the button toggle.
selectedselectedbooleanfalseWhether or not the button is selected.
disableddisabledbooleanfalseWhether or not the button is disabled.
readonlyreadonlybooleanfalseWhether or not the button is readonly.
Events
NameTypeDescription
forge-button-toggle-selectCustomEvent<IButtonToggleSelectEventData>Dispatches when the user toggles the button.
Slots
NameDescription
(default)The default/unnamed slot for the button toggle's content.
startTypically reserved for content/icons that render logically before the default slot content.
endTypically reserved content/icons that render logically after the default slot content.
CSS Parts
NameDescription
::part(root)The root container element.
::part(focus-indicator)The focus indicator element.
::part(state-layer)The state layer surface element.
CSS Custom Properties
NameDescription
--forge-button-toggle-displayThe `display` style for the button toggle container element.
--forge-button-toggle-min-widthThe minimum width.
--forge-button-toggle-spacingThe spacing between the button toggle and its content.
--forge-button-toggle-padding-blockThe padding on the block axis.
--forge-button-toggle-padding-inlineThe padding on the inline axis.
--forge-button-toggle-colorThe color of the button toggle content.
--forge-button-toggle-backgroundThe background of the button toggle.
--forge-button-toggle-cursorThe cursor of the button toggle.
--forge-button-toggle-border-widthThe border-width of the button toggle.
--forge-button-toggle-border-styleThe border-style of the button toggle.
--forge-button-toggle-border-colorThe border-color of the button toggle.
--forge-button-toggle-shapeThe shape radius of the button toggle.
--forge-button-toggle-shape-start-startThe start-start shape radius of the button toggle.
--forge-button-toggle-shape-start-endThe start-end shape radius of the button toggle.
--forge-button-toggle-shape-end-startThe end-start shape radius of the button toggle.
--forge-button-toggle-shape-end-endThe end-end shape radius of the button toggle.
--forge-button-toggle-selected-backgroundThe background of the button toggle when selected.
--forge-button-toggle-selected-colorThe color of the button toggle content when selected.
--forge-button-toggle-selected-disabled-backgroundThe background of the button toggle when selected and disabled.
--forge-button-toggle-disabled-opacityThe opacity of the button toggle when disabled.
--forge-button-toggle-disabled-cursorThe cursor of the button toggle when disabled.
--forge-button-toggle-disabled-colorThe color of the button toggle content when disabled.
--forge-button-toggle-disabled-backgroundThe background of the button toggle when disabled.
--forge-button-toggle-transition-durationThe transition-duration of various properties.
--forge-button-toggle-transition-timingThe transition-timing of various properties.
Methods
NameReturnsDescription
focus(options)void
click()void

Accessibility documentation coming soon.

Loading Forge chat…