Bangladesh
Plate input
Metro or district, class letter, six digits, and the plate drawn in Bangla as on the car.
Value: DHAKA METRO-GA 12-3456
plate-input.tsx
"use client";
import { FormField, PlateInput } from "@waveinno/ui";
import * as React from "react";
export default function PlateDemo() {
const [plate, setPlate] = React.useState("DHAKA METRO-GA 12-3456");
return (
<div className="space-y-6">
<FormField label="Vehicle" hint={plate ? `Value: ${plate}` : "Six digits complete the plate."}>
<PlateInput defaultValue="DHAKA METRO-GA 12-3456" onValueChange={setPlate} />
</FormField>
<FormField label="Drawn in English">
<PlateInput defaultValue="CHATTA METRO-KA 11-8890" plateScript="latin" />
</FormField>
</div>
);
}Import#
Everything comes from the package root. The example above uses:
your-component.tsx
import { FormField, PlateInput } from "@waveinno/ui";Props#
Read from the source of this version, so they match the code exactly.
<PlateInput>
src/components/ui/plate-input.tsx| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | |
defaultValue | string | "" | |
onValueChange | (plate: string, parts: PlateParts & { valid: boolean }) => void | — | |
preview | boolean | true | Draw the plate next to the fields. Default true. |
plateScript | "bn" | "latin" | "bn" | |
state | InputState | "default" | |
disabled | boolean | — | |
className | string | — |
<FormField>
src/components/ui/form-field.tsx| Prop | Type | Default | Description |
|---|---|---|---|
label | React.ReactNode | — | |
htmlFor | string | — | The control's id, so clicking the label focuses it. |
required | boolean | — | |
hint | React.ReactNode | — | |
error | React.ReactNode | — | |
warning | React.ReactNode | — | |
success | React.ReactNode | — | |
count | { value: number; max: number } | — | Character counter, e.g. { value: note.length, max: 240 }. |
className | string | — | |
childrenrequired | React.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