Skip to content
Inputs & Forms

TagsInput

client48 kB
@stellaria/nebula-webTagsInputProps

Preview

Props

23
PropTypeDefault

allowDuplicates

booleanfalse

className

string

clearable

boolean

defaultValue

readonly string[]

description

ReactNode

disabled

booleanfalse

error

string | boolean

errorDisplay

ErrorDisplay"tooltip"

field

NebulaField<string[]>

label

ReactNode

maxTags

number

name

string

onChange

((value: string[]) => void)

placeholder

string

readOnly

booleanfalse

removeLabel

((tag: string) => string)

required

booleanfalse

rootClassName

string

size

Size"md"

splitChars

readonly string[][","]

surface

FieldSurface"outline"

validate

((tag: string) => boolean)

value

readonly string[]

Slot props

10

Each one spreads over an inner element, so you can restyle a region without forking the component.

PropTypeDefault

bodyProps

Wrapper for the control.

BoxSlotProps

descriptionProps

Help text below the label. Only rendered with `description`.

TextSlotProps

errorProps

Configures the `FieldError`. With `errorDisplay="tooltip"` it spreads whole; with `"text"` there is no `FieldError` to configure — it is a `Text` with `role="alert"` — and only `className` is honoured.

Omit<FieldErrorProps, "children">

headerProps

The label and description row. Not rendered when the field has neither.

BoxSlotProps

inputProps

The text field. It spreads AFTER the component keyboard handler, so an `onKeyDown` here takes out add-on-Enter and backspace-to-remove.

Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">

labelProps

The field label. It lands on the `<label>`, which already carries the control `htmlFor`.

TextSlotProps

removeProps

The cross that removes each tag. Not rendered when the field is read-only or disabled.

ButtonCloseProps

requiredProps

The required asterisk, which lives inside the label. Only rendered with `required`.

BoxSlotProps

tagLabelProps

The label of each tag.

TextSlotProps

tagProps

Every tag added. It spreads over ALL of them; they carry `data-disabled`.

BoxSlotProps

Also accepts

On top of its own props, this component forwards these groups.

Style props · 127