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

Select

Select components are comboboxes that present a list of options to users for single or multi-selection.

AppleBananaCherry

Overview

A select component allows users to choose one or more options from a list of predefined choices. It displays the selected value in a compact input field and reveals a dropdown menu when selected or focused. The select component is ideal for conserving screen space while providing users with multiple options in an organized, accessible format.

Usage

forge-select presents a list of forge-option (optionally grouped with forge-option-group) inside a field frame, and supports label, placeholder, multiple, and showSelectAll. Use it to recommend a default from a closed set of options; reach for a autocomplete instead once a list runs past 10 or so options, or a radio group instead when every option must stay visible for comparison.

Rules

Do
Use concise, consistent labels that describe the meaning of the field.Use sentence case for every option label.Order options logically — alphabetical, numeric, or chronological.Recommend a sensible default option when one exists.
Don't
Don't use a select for more than about 10 options — use an autocomplete instead.Don't use a select when only one option can be true and both must stay visible — use radio buttons instead.Don't use a colon after the label.Don't set option labels in all caps.

Grouped options

Wrap related forge-option elements in a forge-option-group to label them as a set.

Related options grouped under a labeled forge-option-group.

Multiple selection

Set multiple to let a user choose more than one option; selected options render as a comma-separated list in the field.

Multiple lets a user choose more than one option.

Select all

Pair multiple with showSelectAll to add a “select all” option above the list — set selectAllLabel to customize its text.

showSelectAll adds a select-all option above a multiple select's list.

Clicking “select all” fires forge-select-all before the standard change event, with detail.value (every option’s value, or an empty array when deselecting) and detail.isAllSelected. Calling preventDefault() on forge-select-all also suppresses the change event that would otherwise follow it.

selectEl.addEventListener("forge-select-all", (event) => {
  if (!userMaySelectAll) {
    event.preventDefault();
  }
});

Label position

Set the field’s label-position to inset (default), block-start, or inline-start to place the label above, before, or floating inside the field.

Above

label-position set to block-start.

Inline

label-position set to inline-start.

Select dropdown

Attach a forge-select-dropdown to a button trigger instead of a field, for a select-style menu that isn’t tied to a form field’s layout.

A forge-select-dropdown attached to a button trigger instead of a field.

Select components are comboboxes that present a list of options to users for single or multi-selection.

import "@tylertech/forge/select";
Properties
PropertyAttributeTypeDefaultDescription
labellabelstring—Controls the label text.
placeholderplaceholderstring—Controls the placeholder text.
readonlyreadonlybooleanfalseControls whether the select is readonly.
showSelectAllshow-select-allboolean—Gets/sets whether to show the select all option when in multiple mode.
selectAllLabelselect-all-labelstring—Gets/sets the label for the select all option.
floatLabelfloat-labelbooleanfalseWhether the label floats above the field.
densitydensityFieldDensity"default"The density of the field.
densedensebooleanfalseWhether the field is dense.
disableddisabledbooleanfalseWhether the field is disabled.
requiredrequiredbooleanfalseWhether the field is required.
labelPositionlabel-positionFieldLabelPosition"inset"The position of the label.
valuevalueany—Gets/sets the value.
selectedIndexselected-indexnumber | number[]—Gets/sets the selected index.
options—ISelectOption[] | ISelectOptionGroup[]—Gets/sets the available options.
multiplemultipleboolean—Gets/sets the multiple select state.
openopenboolean—Gets/sets the open state.
optionBuilder—SelectOptionBuilder—Gets/sets the option builder function.
selectedTextBuilder—SelectSelectedTextBuilder—Gets/sets the selected text builder function.
beforeValueChange—SelectBeforeValueChangeCallback<any>—Gets/sets the before value change callback.
popupClasses—string | string[]; -—Gets/sets the list of classes to apply to the popup element.
popupHeaderBuilder—ListDropdownHeaderBuilder—Gets/sets the callback function for generating header content within the popup.
popupFooterBuilder—ListDropdownFooterBuilder—Gets/sets the callback function for generating header content within the popup.
syncPopupWidthsync-popup-widthbooleanfalseGets/sets whether the popup width is synchronized with the popup target width.
optionLimitoption-limitnumber—Gets/sets the maximum number of options to display in the dropdown.
observeScrollobserve-scrollbooleanfalseControls the observation of scroll events on the dropdown.
observeScrollThresholdobserve-scroll-thresholdnumber0The number of pixels from the bottom to trigger the scroll bottom event. Only applicable if `observeScroll` is true.
constrainPopupWidth—booleantrueGets/sets whether the popup width will be constrained to a max width of the viewport width (default: `100vw`).
wrapOptionTextwrap-option-textbooleanfalseGets/sets whether the options will wrap their text or not. This only applies if `constrainPopupWidth` is `true`, if there is an explicit width set via CSS.
popoverPlacementpopover-placementOverlayPlacement"bottom"Gets/sets the placement of the popover.
popoverOffsetpopover-offsetIOverlayOffset—Gets/sets the offset of the popover.
popoverFlippopover-flipOverlayFlipState"auto"Gets/sets the flip state of the popover.
popoverShiftpopover-shiftOverlayShiftState"auto"Gets/sets whether the popover should shift to fit within the viewport.
popoverFallbackPlacements—PositionPlacement | null—Gets/sets the fallback placements of the popover.
labelAlignmentlabel-alignmentFieldLabelAlignment"default"The alignment of the label.
invalidinvalidbooleanfalseWhether the field is invalid.
optionaloptionalbooleanfalseWhether the field is optional.
variantvariantFieldVariant"outlined"The variant of the field.
themethemeFieldTheme"default"The theme of the field.
shapeshapeFieldShape"default"The shape of the field.
popoverIconpopover-iconbooleanfalseWhether the popover icon is displayed.
supportTextInsetsupport-text-insetFieldSupportTextInset"none"The inset of the support text.
Events
NameTypeDescription
forge-select-scrolled-bottomCustomEvent<void>Dispatched when the dropdown list has scrolled to the bottom.
changeCustomEvent<any>Dispatched when the user selects a value.
forge-select-allCustomEvent<SelectSelectAllEventData>Dispatched when the select all option is toggled.
Slots
NameDescription
valueThe selected text to display
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.
accessoryUsed for content such as a button that is logically connected to the field but should appear distinct from the input.
support-textUsed for content that provides additional information about the field. Aligns to the inline start of the field.
support-text-endUsed for content that provides additional information about the field. Aligns to the inline end of the field.
CSS Parts
NameDescription
::part(root)The root container element.
::part(label)The label element.
::part(text-container)The element container for the selected text.
::part(text)The element containing the selected text.
::part(container)The container element surrounding the input.
::part(input)The element containing te input slot.
::part(start)The element containing the start slot.
::part(end)The element containing the end slot.
::part(popover-icon)The popover icon element.
::part(accessory)The element containing the accessory slot.
::part(support-text)The support text element.
::part(support-text)The element containing the support text slot.
::part(support-text-end)The element containing the support text end slot.
::part(outline)The element containing the forge-focus-indicator element.
::part(focus-indicator)The focus indicator element.
CSS Custom Properties
NameDescription
--forge-select-placeholder-colorThe color of the placeholder text.
--forge-field-backgroundThe background of the field surface.
--forge-field-tonal-backgroundThe background of the field surface in the tonal variant.
--forge-field-tonal-background-hoverThe background of the field surface in the tonal variant on hover.
--forge-field-filled-backgroundThe background of the field surface in the filled and raised variants.
--forge-field-outline-styleThe style of the field outline.
--forge-field-outline-widthThe width of the field outline.
--forge-field-shapeThe border radius of the field's corners.
--forge-field-heightThe height of the field in its default density.
--forge-field-inset-heightThe height of the field in its default density when the label is inset.
--forge-field-padding-inlineThe inline padding of the field.
--forge-field-padding-inline-startThe inline start padding of the field.
--forge-field-padding-inline-endThe inline end padding of the field.
--forge-field-inner-padding-inlineThe padding between elements slotted into the field.
--forge-field-support-text-margin-blockThe margin between the support text and the field.
--forge-field-support-text-gapThe minimum gap between the support text and the support text end.
--forge-field-support-text-padding-inlineThe inline padding of the support text.
--forge-field-support-text-padding-inline-startThe inline start padding of the support text.
--forge-field-support-text-padding-inline-endThe inline end padding of the support text.
--forge-field-label-margin-inlineThe margin between the label and the field when the label is in an inline position.
--forge-field-label-margin-blockThe margin between the label and the field when the label is in the block start position.
--forge-field-required-paddingThe padding between the required indicator and the label.
--forge-field-required-contentThe content of the required indicator.
--forge-field-optional-paddingThe padding between the optional indicator and the label.
--forge-field-optional-contentThe content of the optional indicator.
--forge-field-multiline-resizeThe direction the field can be resized when multiline.
--forge-field-multiline-min-inline-sizeThe minimum inline size the field can be resized to when multiline.
--forge-field-multiline-max-inline-sizeThe maximum inline size the field can be resized to when multiline.
--forge-field-multiline-min-block-sizeThe minimum block size the field can be resized to when multiline.
--forge-field-multiline-max-block-sizeThe maximum block size the field can be resized to when multiline.
--forge-field-popover-icon-transition-durationThe duration of the popover icon animation.
--forge-field-popover-icon-transition-timingThe timing function of the popover icon animation.
--forge-field-popover-icon-open-rotationThe rotation of the popover icon when open.
--forge-field-surface-animation-durationThe duration of background and outline animations.
--forge-field-surface-animation-timingThe timing function of background and outline animations.
--forge-field-surface-floating-animation-durationThe duration of the floating label animation.
--forge-field-surface-floating-animation-timingThe timing function of the floating label animation.
--forge-field-focus-indicator-widthThe width of the focus indicator.
--forge-field-disabled-opacityThe opacity of the field when disabled.
--forge-field-disabled-backgroundThe background of the field when disabled.
Methods
NameReturnsDescription
floatLabelWithoutAnimation(value)voidFloats the label without an animation. Only applies when the label is inset.

Keyboard interaction

Key Action
Space / Arrow up / Arrow down (closed) Opens the select. The arrow keys also highlight the first option.
Escape / Space (open) Closes the select.
Tab / Enter Selects the focused option and closes the select. If “Select all” is focused, toggles all options.
Arrow down / Arrow up Highlights the next or previous option.
Home / End Highlights the first or last option that isn’t disabled.

In multiple-select mode, Enter toggles the focused option’s selected state instead of closing the select.

Accessible label

Set the label property to give the select a visible label. forge-select also uses it as the aria-label on the host element (which has role="combobox").

If you need an accessible name that differs from the visible label, or you aren’t showing a label at all, set aria-label or aria-labelledby on forge-select directly. An aria-label you provide is preserved and won’t be overwritten by the label property.

Loading Forge chat…