TagsInput
@stellaria/nebula-webTagsInputPropsPreview
Props
23| Prop | Type | Default |
|---|---|---|
allowDuplicates | boolean | false |
className | string | — |
clearable | boolean | — |
defaultValue | readonly string[] | — |
description | ReactNode | — |
disabled | boolean | false |
error | string | boolean | — |
errorDisplay | ErrorDisplay | "tooltip" |
field | NebulaField<string[]> | — |
label | ReactNode | — |
maxTags | number | — |
name | string | — |
onChange | ((value: string[]) => void) | — |
placeholder | string | — |
readOnly | boolean | false |
removeLabel | ((tag: string) => string) | — |
required | boolean | false |
rootClassName | string | — |
size | Size | "md" |
splitChars | readonly string[] | [","] |
surface | FieldSurface | "outline" |
validate | ((tag: string) => boolean) | — |
value | readonly string[] | — |
Slot props
10Each one spreads over an inner element, so you can restyle a region without forking the component.
| Prop | Type | Default |
|---|---|---|
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.