BDMG UI

Zip Code Input

Input restricted to 5 numeric digits for US zip codes.

Installation

tsx
import { ZipCodeInput } from "@workspace/ui/components/zip-code-input"

Basic usage

tsx
const [zip, setZip] = useState("")

<ZipCodeInput
  label="Zip code"
  placeholder="12345"
  value={zip}
  onChange={setZip}
/>

Props

PropTypeDefaultDescription
labelstring-Label above the input.
errorstring-Error message shown below.
hintstring-Hint text below.
valuestring-5-digit zip code.
onChange(value: string) => void-Called when value changes (max 5 digits).
containerClassNamestring-Classes for the wrapper.
inputClassNamestring-Classes for the input element.