tag-input

v4.15.0arrow_drop_down
v4.15.0
STATUS
Passing
DOWNLOADS
1
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
N/A
1 contributor
Install tag-input as a package?
Copied
npm i @bit/segmentio.evergreen.tag-input
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
chevron_left
chevron_right
Properties
NameTypeDefault valueDescription
children
node

The badge content

onRemove
function

Callback invoked when the removal icon is clicked. (event) => void

isRemovable
bool

Whether or not the tag can be removed.

addOnBlur
boolfalse

Whether or not the inputValue should be added to the tags when the input blurs.

className
string

The class name to apply to the container component.

disabled
boolfalse

Whether or not the input should be disabled.

height
number32

The vertical size of the input

inputProps
object

Props to pass to the input component. Note that ref and key are not supported. See inputRef.

inputRef
function

Ref handler for the element. (input: HTMLInputElement | null) => void

onAdd
function

Callback invoked when new tags are added. Returning false will prevent clearing the input. (values: Array) => void | false

onBlur
function

Callback invoked when focus on the input blurs. (event) => void

onChange
function

Callback invoked when the tag values change. Returning false will prevent clearing the input. (values: Array) => void | false

onFocus
function

Callback invoked when the input receives focus. (event) => void

onInputChange
function

Callback invoked when the value of the is changed. Shorthand for inputProps={{ onChange }}. (event) => void

onRemove
function

Callback invoked when a tag is removed. Receives value and index of removed tag. (value: string | node, index: number) => void

separator
string | RegExp | false/[,\n\r]/

Value or RegExp to split on pasted text or on enter keypress

tagProps
object | function{}

Provide props to tag component (actually Badge, for now).

theme
(required)
object

Theme provided by ThemeProvider.

values
node[][]

Controlled tag values. Each value is rendered inside a tag.

Help and resources