Getting startedComponentsDesign tokensThemingTheme synthesizerFrameworksAccessibilityUtilitiesServer renderingBrowser supportContributingChangelogApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip
ARC UIARC Radiant Components
v4.9DocsComponentsTokensSynthesizer
Getting startedFrameworksServer renderingDesign tokensThemingTheme synthesizerTypographyUtilitiesAll componentsAccessibilityBrowser supportChangelogContributingStatsApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip

Tag Input

A text field that turns each entry into a removable chip, with optional suggestions as you type.

ComponentsTag Input
inputinteractivebeta
<arc-tag-input>

Overview

TagInput collects a list of free-text values as removable chips. Pressing Enter or typing the `delimiter` (a comma by default) adds the trimmed text as a tag, and pasted text is split on the delimiter into several tags at once. Give it a `suggestions` array and matching values appear in a dropdown as the reader types. Free text is still accepted unless you set `no-custom` (`allowCustom = false`), and then only suggestions can be added. A duplicate isn't added, and the existing chip shakes to show why. The shake is off under reduced motion. TagInput is form-associated and submits one FormData entry per tag under its `name`, so the server gets a repeated field. Once `max-tags` is reached, entry is disabled and a "-- max reached" hint appears.

Guidelines

Do

  • Set a `label`. It renders as a `<label>` for the text input, so screen readers announce it
  • Provide `suggestions` when there's a known vocabulary, to speed up entry and cut typos
  • Set `allowCustom` to false when values must come from that vocabulary
  • Set `max-tags` when the system receiving the values accepts only so many
  • Listen to `arc-input` to fetch suggestions from a server as the reader types

Don't

  • Don't use TagInput when readers pick from a fixed list and want to browse it. Use MultiSelect
  • Don't pick a delimiter that can appear inside a value
  • Don't use very long tag values. They overflow the chips
  • Don't rely on the shake alone to explain a rejected value where it matters. Set an `error` message too

Features

  • Keyboard: Backspace in an empty input removes the last tag, ArrowLeft from the start of the input moves into the chips, the arrows move between chips, Backspace or Delete removes one, and Escape returns to the input
  • In the suggestion list, ArrowUp and ArrowDown move and Enter or a click adds the value

Preview

Usage

This component needs JavaScript. Use the Web Component or a framework wrapper.

<arc-tag-input
  label="Topics"
  placeholder="Add a topic..."
  suggestions='["JavaScript","TypeScript","Python"]'
  max-tags="5"
></arc-tag-input>

API

delimiterstring','
Character that commits the current text as a tag when typed; pasted text is split on it.
labelstring''
Visible label rendered above the field in a small uppercase style.
placeholderstring''
Hint text shown inside the field when no tags exist and the input is empty.
namestring''
Form field name. Each tag is submitted as its own FormData entry under this name.
disabledbooleanfalse
Disables the control, preventing interaction and reducing opacity to 50%.
errorstring''
Error message shown below the field; also applies error styling to the border.
valuestring[][]
Array of current tags. Updated on add/remove and emitted via arc-change.
suggestionsstring[][]
Autocomplete candidates. When non-empty, typing filters them into a dropdown listbox.
maxTagsnumber0
Maximum number of tags (0 = unlimited). At the limit, entry is disabled with a "-- max reached" hint.
allowCustombooleantrue
When false, only values from suggestions can be added; free text is rejected.
readonlybooleanfalse
Prevents adding or removing tags while the field stays focusable and the tags still submit with the form.
size'sm' | 'md' | 'lg''md'
Control size. md is the default; sm and lg scale the field height and padding.
formAssociatedbooleantrue
propertiesobject{ // flag(), unlike `disabled`. The exclusion in props.js is specifically // about form-associated *platform* semantics: a `disabled` content // attribute that is merely present makes the element actually disabled // per the HTML spec, and formDisabledCallback assigns the property back, // so no converter can win. Neither of these is platform-mapped: // `required` is enforced by _computeValidity() below and `readonly` by // each component's own interaction handlers, so the stock converter buys // nothing here and costs the usual bug: `required="false"` read as true, // blocking submission of a form the author meant to leave optional. // Finding #48's shape, across all 26 form controls at once. required: flag(false), readonly: flag(false), }
Lit merges static properties up the prototype chain, so every consumer gets these without declaring them. required participates in constraint validation below; readonly reflects for styling and is enforced by each component's interaction handlers (the mixin can't know which gestures mutate state).
autoValidatesbooleantrue
Components that run their own constraint-validation logic (pattern checks, range checks) opt out of the automatic required sync by overriding this to false, and own the whole validity flag set instead.
form
validity
validationMessage
requiredbooleanfalse

Methods

checkValidity()boolean
Whether the control currently satisfies its constraints, per the native constraint-validation API. Fires invalid on the element when it does not, and reports nothing to the user.
reportValidity()boolean
As checkValidity(), but also shows the browser's validation message against the control when it fails.

Events

arc-changedetail:{ value: string[] }
Fired when a tag is added or removed; detail contains { value }
arc-input
Fired as the user types; detail contains { query }

See also