Bangladesh
Plate input
Metro or district, class letter, six digits, and the plate drawn in Bangla as on the car.
2 examples Code and Figma for each
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>
);
}Examples#
Each one on its own: copy its code into your app, or copy it to Figma and paste it on the canvas as layers.
Drawn in Bangla
Area, class letter and number, and the plate drawn as on the car.
plate-input-bangla.tsx
"use client";
import { FormField, PlateInput } from "@waveinno/ui";
export default function PlateInputBanglaExample() {
return (
<div className="w-full max-w-md"><FormField label="Vehicle"><PlateInput defaultValue="DHAKA METRO-GA 12-3456" /></FormField></div>
);
}Drawn in English
The same plate in Latin letters, for forms in English.
plate-input-latin.tsx
"use client";
import { FormField, PlateInput } from "@waveinno/ui";
export default function PlateInputLatinExample() {
return (
<div className="w-full max-w-md"><FormField label="Vehicle"><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