Bangladesh

NID input

10, 13 or 17 digits, grouped as printed; names the kind and never accepts a wrong length.

Smart card
Old NID, with birth year

Import#

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

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

Props#

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

<NidInput>

src/components/ui/nid-input.tsx
PropTypeDefaultDescription
valuestring—
defaultValuestring""
onValueChange(digits: string, info: { valid: boolean; kind: NidKind | null }) => void—
stateInputState"default"
labelsPartial<Record<NidKind, string>>—

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

<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