Primitives

Tag input

Enter, comma or paste a list; Backspace marks then removes; validate, max, suggestions.

DHA-GA 12-3456DHA-KHA 45-10202/5

Enter or comma adds one; paste a list to add many.

Karim Ahmed

Suggestions from your team.

24 hoursEV chargingCovered

Import#

Everything comes from the package root. The example above uses:

your-component.tsx
import { FormField, TagInput } from "@waveinno/ui";

Props#

Read from the source of this version, so they match the code exactly.

<TagInput>

src/components/ui/tag-input.tsx
PropTypeDefaultDescription
valuestring[]—
defaultValuestring[][]
onValueChange(tags: string[]) => void—
placeholderstring"Add…"
suggestionsstring[]—
maxnumber—
validate(tag: string) => string | void | undefined | null—Return a reason to refuse a tag, or nothing to accept it.
transform(tag: string) => string(t) => t.trim()Change a tag before it is added: trim, upper-case a plate.
variant"soft" | "outline" | "solid""soft"
stateInputState"default"
disabledboolean—
aria-labelstring—
classNamestring—

<FormField>

src/components/ui/form-field.tsx
PropTypeDefaultDescription
labelReact.ReactNode—
htmlForstring—The control's id, so clicking the label focuses it.
requiredboolean—
hintReact.ReactNode—
errorReact.ReactNode—
warningReact.ReactNode—
successReact.ReactNode—
count{ value: number; max: number }—Character counter, e.g. { value: note.length, max: 240 }.
classNamestring—
childrenrequiredReact.ReactNode—

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui