Skip to content

Latest commit

 

History

History
31 lines (31 loc) · 3.42 KB

Props.md

File metadata and controls

31 lines (31 loc) · 3.42 KB

Props

Name Type Default Description
align string 'justify' Specify menu alignment. The default value is justify, which makes the menu as wide as the input and truncates long values. Specifying left or right will align the menu to that side and the width will be determined by the length of menu item values.
allowNew boolean false Allows the creation of new selections on the fly. Any new items will be added to the list of selections, but not the list of original options unless handled as such by Typeahead's parent. The newly added item will always be returned as an object even if the other options are simply strings, so be sure your onChange callback can handle this.
bsSize one of: 'large', 'lg', 'small', 'sm' Specify the size of the input.
caseSensitive bool false Whether or not filtering should be case-sensitive.
defaultSelected array [] Specify any pre-selected options. Use only if you want the component to be uncontrolled.
disabled boolean Whether to disable the input. Will also disable selections when multiple={true}.
dropup boolean false Specify whether the menu should appear above the input.
emptyLabel string 'No matches found.' Message to display in the menu if there are no valid results.
filterBy function or array [] Either an array of fields in option to search, or a custom filtering callback.
labelKey string or function 'label' Specify which option key to use for display or a render function. By default, the selector will use the label key.
maxHeight number 300 Maximum height of the dropdown menu, in px.
maxResults number 100 Maximum number of results to display by default. Mostly done for performance reasons so as not to render too many DOM nodes in the case of large data sets.
minLength number 0 Number of input characters that must be entered before showing results.
multiple boolean false Whether or not multiple selections are allowed.
name string Name property for the input
newSelectionPrefix string 'New selection:' Provides the ability to specify a prefix before the user-entered text to indicate that the selection will be new. No-op unless allowNew={true}.
onBlur function Callback fired when the input is blurred. Receives an event.
onChange function Callback fired whenever items are added or removed. Receives an array of the selected options.
onFocus function Callback fired when the input is focused. Receives an event.
onInputChange function Callback fired when user-input text changes. Receives the text string.
options required array Full set of options, including any pre-selected options.
paginate boolean true Give user the ability to display additional results if the number of results exceeds maxResults.
paginateResults number 100 DEPRECATED. Use maxResults and paginate instead.
paginationText string 'Display additional results...' Prompt displayed when large data sets are paginated.
placeholder string Placeholder text for the input.
renderMenuItemChildren function Provides a hook for customized rendering of menu item contents.
renderToken function Provides a hook for customized rendering of tokens when multiple selections are enabled.
selected array [] The selected option(s) displayed in the input. Use this prop if you want to control the component via its parent.