Currency Picker
The currency rates are shown in: a small pill (the sign and the code) that opens a searchable list, a sheet from the bottom on a phone.
Preview
Rates in Indian rupee
Usage
import { CurrencyPicker } from "zostel-ui";
<CurrencyPicker
currencies={[{ code: "INR", name: "Indian rupee", symbol: "₹" }, …]}
value={code}
onValueChange={setCode}
note="Shown in your currency for reference; you pay in rupees."
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
currencies | CurrencyOption[]: { code: string; name: string; symbol: string } | — | The list, in the order to show it. The current one carries the check (and says so to a screen reader). |
value · onValueChange | string · (code) => void | — | The code shown, and the pick. |
note | ReactNode | — | Under the list: what the choice changes, and what it doesn’t. |
title | string | "Show rates in" | The list’s name: the sheet’s title on a phone, and what a screen reader hears for the search and the list. |
aria-label · aria-labelledby | string | "Currency" | The field’s name, read before the code it shows (“Currency, INR, Indian rupee”). |
className | string | — | More classes on the pill. |
currenciesCurrencyOption[]: { code: string; name: string; symbol: string }The list, in the order to show it. The current one carries the check (and says so to a screen reader).
value · onValueChangestring · (code) => voidThe code shown, and the pick.
noteReactNodeUnder the list: what the choice changes, and what it doesn’t.
titlestring"Show rates in"The list’s name: the sheet’s title on a phone, and what a screen reader hears for the search and the list.
aria-label · aria-labelledbystring"Currency"The field’s name, read before the code it shows (“Currency, INR, Indian rupee”).
classNamestringMore classes on the pill.
On zostel.com
Beside every rate: in the booking bar, the summary and the footer. Type to find, the arrow keys move, Enter picks, Escape closes and the focus goes back to the pill.