Primitives

Number, password and code inputs

Numbers clamp when you leave the field, not while typing; Caps Lock is flagged; a pasted code fills every box.

cars

Cars the site can hold. ↑ ↓ to step, Shift for ten.

৳

Caps Lock is flagged while it is on.

Strength

Verification code

Paste a code to fill every box.

split · 3–3

underline · a PIN, masked

error

Import#

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

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

Props#

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

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

<NumberInput>

src/components/ui/number-input.tsx
PropTypeDefaultDescription
valuenumber | null—
defaultValuenumber | nullnull
onValueChange(value: number | null) => void—
minnumber-Infinity
maxnumberInfinity
stepnumber1
precisionnumber—Decimal places kept. Default: as many as `step` has.
prefixReact.ReactNode—Inside the box, before the number: "৳", "+880".
suffixReact.ReactNode—After it: "min", "cars", "%".
stepper"split" | "stack" | "none""split"
stateInputState"default"

Also takes Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "type" | "min" | "max" | "step" | "prefix">.

<PasswordInput>

src/components/ui/password-input.tsx
PropTypeDefaultDescription
stateInputState—
strengthboolean—A meter under the field: for choosing a new password.

Also takes Omit<React.InputHTMLAttributes<HTMLInputElement>, "type">.

<PinInput>

src/components/ui/pin-input.tsx
PropTypeDefaultDescription
lengthnumber6
valuestring—
defaultValuestring""
onValueChange(value: string) => void—
onComplete(value: string) => void—
type"numeric" | "alphanumeric""numeric"`numeric` (default) brings up the number pad; `alphanumeric` takes letters too.
maskboolean—Dots instead of characters: PINs, not one-time codes.
variant"boxed" | "underline" | "split""boxed"
size"md" | "lg""md"
errorboolean—
disabledboolean—
autoFocusboolean—
aria-labelstring"Verification code"Read aloud as the group's name.
classNamestring—

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