@hanzo/ui

Currency Picker

import { CurrencyPicker } from '@hanzo/ui'

No examples yet.

Types

export type CurrencyOption = {
  /** ISO 4217, e.g. "USD". */
  code: string
  /** e.g. "US Dollar". */
  name: string
  symbol?: string
  disabled?: boolean
}
export type CurrencyPickerProps = {
  currencies: CurrencyOption[]
  value?: string | null
  defaultValue?: string | null
  onValueChange?: (code: string | null) => void
  /** Shown in the segment when nothing is picked. */
  placeholder?: string
  /** What the segment shows for the picked currency; its code by default. */
  renderValue?: (currency: CurrencyOption | undefined) => ReactNode
  /** A row's label; "Name (CODE)" by default. */
  getOptionLabel?: (currency: CurrencyOption) => string
  /** What a row is found by beyond its label; the name, the code and the symbol by default. */
  getSearchText?: (currency: CurrencyOption) => string
  /** The picked currency first in the list. */
  selectedFirst?: boolean
  /** Close the list on a pick (default true). */
  closeOnSelect?: boolean
  open?: boolean
  defaultOpen?: boolean
  onOpenChange?: (open: boolean) => void
  disabled?: boolean
  /** The segment's name to assistive technology, before the picked currency. */
  label?: string
  searchLabel?: string
  emptyLabel?: string
}

Exports

CurrencyPickertype CurrencyOptiontype CurrencyPickerProps