Primitives

Input states and FormField

Error (shakes once, announced), warning, success; leading and trailing slots; one message line, so the form never jumps.

Verified

৳per day

Higher than every other car park in Gulshan.

Plate, phone or ticket number.

43/60

Import#

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

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

Props#

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

<Button>

src/components/ui/button.tsx
PropTypeDefaultDescription
asChildbooleanfalse
loadingboolean—

Also takes ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>.

<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—

<Input>

src/components/ui/input.tsx
PropTypeDefaultDescription
state"default" | "error" | "warning" | "success""default"
leadingReact.ReactNode—Icon or text inside the box, before the value (a search icon, "৳", "+880").
trailingReact.ReactNode—After the value: a unit, a clear button, a status icon.

Also takes InputHTMLAttributes<HTMLInputElement>.

<Textarea>

src/components/ui/input.tsx
PropTypeDefaultDescription
state"default" | "error" | "warning" | "success""default"

Also takes TextareaHTMLAttributes<HTMLTextAreaElement>.

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