label | string · requiredAccessible label for the input. |
|---|
searchSource | SearchSource<T> · requiredData source providing search and bootstrap methods for populating the dropdown. |
|---|
value | T[] · requiredArray of currently selected items. |
|---|
onChange | (items: T[], change: TokenizerChange<T>) => void · requiredCalled when selection changes. The change argument includes the affected item and type ('add' | 'create' | 'remove' | 'reorder'). Additions and removals (including Backspace on an empty input) are announced to screen readers via a polite live region. |
|---|
placeholder | stringInput placeholder text. Only shown when no tokens are selected. |
|---|
maxEntries | numberMaximum number of selections allowed. Input is hidden when the limit is reached. |
|---|
hasClear | boolean · default falseShow a clear-all button for bulk removal of all tokens. |
|---|
renderToken | (item: T, onRemove: () => void) => ReactNodeCustom render function for selected tokens. Default renders Token with label and onRemove. |
|---|
renderItem | (item: T) => ReactNodeCustom render function for dropdown items. Default renders TypeaheadItem. |
|---|
isDisabled | boolean · default falseDisables the input and all token interactions. |
|---|
htmlName | stringThe HTML name attribute for form submissions. Renders one hidden input per selected item id. |
|---|
disabledMessage | stringExplains why the tokenizer is disabled. With isDisabled, shows a tooltip on hover/keyboard focus and keeps the input focusable via aria-disabled (input stays blocked). Use this instead of wrapping a disabled Tokenizer in Tooltip. Disabled controls swallow the hover events an external Tooltip needs. |
|---|
status | {type: 'warning' | 'error' | 'success', message?: string}Validation status object with type and message for error/warning/success states. |
|---|
statusVariant | 'attached' | 'detached' · default 'attached'How the status message is placed relative to the input. attached overlaps directly below the input (bordered treatment); detached floats below as a separate element with spacing. |
|---|
isLabelHidden | boolean · default falseVisually hides the label while keeping it accessible. |
|---|
description | stringHelper text displayed below the label. |
|---|
isRequired | boolean · default falseMarks the field as required. |
|---|
isOptional | boolean · default falseShows an optional indicator on the label. |
|---|
labelTooltip | string |
|---|
hasEntriesOnFocus | boolean · default falseShow bootstrap results on focus before typing. |
|---|
maxMenuItems | number · default 10Maximum number of search results to display. The hasCreate entry is offered on top of them, so a menu can show one more than this. |
|---|
menuWidth | numberFixed dropdown width in pixels. The menu never shrinks below its anchor width. |
|---|
minQueryLength | number · default 1Minimum query length before the search source is queried. Below it no search runs, and the menu stays closed — unless hasCreate is set, in which case the "Create ..." entry is still offered, being derived from the typed text rather than fetched for it. |
|---|
emptySearchResultsText | string · default 'No results found'Text shown when search returns no results. |
|---|
hasAutoFocus | boolean · default falseAuto-focus the input on mount. |
|---|
size | 'sm' | 'md' | 'lg' · default 'md'Input and token size. |
|---|
debounceMs | number · default 150Debounce delay in ms before triggering search. Set to 0 for synchronous sources. |
|---|
hasCreate | boolean · default falseAllow users to create new tokens from free-text input. When true, a "Create" option appears in the dropdown for typed text that doesn't match existing results. The onChange change type is 'create' for these items. |
|---|
onChangeQuery | (query: string) => voidCallback fired when the search query text changes. |
|---|
startIcon | ReactNode | IconTypeIcon to display at the start of the input, before any tokens. Accepts a semantic icon name, an SVG icon component, or a ReactNode directly. |
|---|
endContent | ReactNodeContent to display at the end of the input row. Useful for buttons, result counts, or other controls. |
|---|
handleRef | React.Ref<TokenizerHandle>Imperative handle exposing focusInput(), focusFirstToken(), focusLastToken(), clearInput(), and selectAll(). |
|---|
width | SizeValueWidth of the field (number = pixels, string used as-is, e.g. "100%"). Sizes the whole field (label, control, and status) so they stay aligned. |
|---|
tokenOverflowBehavior | 'none' | 'unfocusedInline' | 'unfocusedLayer' · default 'none'Controls how tokens overflow when the container is too narrow. |
|---|
onFocus | (e: FocusEvent<HTMLInputElement>) => voidFires when focus enters the tokenizer input. |
|---|
onBlur | (e: FocusEvent<HTMLInputElement>) => voidFires when focus leaves the tokenizer input. |
|---|
xstyle | StyleXStylesStyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value; not an inline style object like style={{}}. |
|---|