Bangladesh

Address picker

8 divisions, 64 districts, in English or Bangla; stores ids so the language can change.

{"division":"dhaka","district":"dhaka","area":"House 12, Road 7, Gulshan 1","postcode":"1212"}

Import#

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

your-component.tsx
import { BdAddressPicker, type BdAddress, Segmented } from "@waveinno/ui";

Props#

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

<BdAddressPicker>

src/components/ui/bd-address.tsx
PropTypeDefaultDescription
valueBdAddress—
defaultValueBdAddress{}
onValueChange(address: BdAddress) => void—
lang"en" | "bn""en"
fields("area" | "postcode")[]["area", "postcode"]Which text fields follow the two lists. Default both.
disabledboolean—
requiredboolean—
labelsPartial<Record<"division" | "district" | "area" | "postcode" | "chooseDivision" | "chooseDistrict" | "divisionFirst", string>>—
classNamestring—

<Segmented>

src/components/ui/segmented.tsx
PropTypeDefaultDescription
valuerequiredT—
onChangerequired(v: T) => void—
optionsrequiredSegmentedOption<T>[]—
classNamestring—
ariaLabelstring—
variantkeyof typeof TRACK"pill"
sizekeyof typeof SIZES"sm"
fullWidthbooleanfalseStretch to the container, options sharing the width equally.

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