TidalUI

Tag input preview

A controlled native tag field with removable tokens, optional consumer suggestions and form-owned values.

pro · Forms · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/tag-input

Import components/ui/tidal.css, components/ui/tag-input.css. Wrap installed components in tidal-scope.

Preview

Tag input component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/tag-input.css";
import{TidalTagInput}from"./components/ui/tag-input";
export default()=><div className="tidal-scope"><TidalTagInput label={"Demo"} onQueryChange={() => {}} query={"value"} tags={[{id:"example",value:"value",label:"Demo",accessibleLabel:"Demo"}]}/></div>;

API and props

TidalTagInput.label (required)
ReactNode

Required label value accepted by this exported component.

TidalTagInput.onQueryChange (required)
(value: string, event: ChangeEvent<HTMLInputElement>) => void

Callback invoked when the query change interaction is proposed.

TidalTagInput.query (required)
string

Required query value accepted by this exported component.

TidalTagInput.tags (required)
ReadonlyArray<TidalTagInputTag>

Required tags value accepted by this exported component.

TidalTagInput.description
ReactNode

Optional description value accepted by this exported component.

TidalTagInput.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalTagInput.error
ReactNode

Optional error value accepted by this exported component.

TidalTagInput.form
string | undefined

Optional form value accepted by this exported component.

TidalTagInput.inputProps
Omit<InputHTMLAttributes<HTMLInputElement>, "disabled" | "form" | "name" | "type" | "value" | "defaultValue" | "id" | "aria-disabled" | "children" | "readOnly"> | undefined

Optional input props value accepted by this exported component.

TidalTagInput.inputRef
Ref<HTMLInputElement> | undefined

Optional input ref value accepted by this exported component.

TidalTagInput.labels
Partial<TidalTagInputLabels> | undefined

Optional labels value accepted by this exported component.

TidalTagInput.maxTags
number | undefined

Optional max tags value accepted by this exported component.

TidalTagInput.name
string | undefined

Optional name value accepted by this exported component.

TidalTagInput.onRemoveTag
((tag: TidalTagInputTag, event: ReactMouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLInputElement>) => void) | undefined

Callback invoked when the remove tag interaction is proposed.

TidalTagInput.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalTagInput.status
ReactNode

Optional status value accepted by this exported component.

TidalTagInput.suggestions
TidalTagInputSuggestions | undefined

Optional suggestions value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas