Skip to content

Props

<VueCurrencyConverter> accepts a large set of props to control behavior, appearance, and data sources. All props are optional — sensible defaults are provided.

PropTypeDefaultDescription
modelValueModel— (req)Bound value for v-model. Holds the current state of the currency input.
listConfigPartial<ListParams>see belowConfiguration for the currency list / behavior. Any subset of ListParams. Unspecified fields fall back to component defaults (below).
apiPartial<ApiConfig>see belowConfiguration for the exchange-rates API (base URL, caching, fetch options, and response mapping). Omitted fields fall back to the built‑in defaults.
itemHeightnumberFixed pixel height for each item row (overrides CSS var–driven sizing if provided).
sizeSizeComponent size token used by your design system (e.g., sm, md, …). Controls overall spacing/row heights via CSS vars.
disabledbooleanfalseDisables user interaction with the input and list.

listConfig

KeyTypeDefaultDescription
itemsPerViewnumberDEFAULT_ITEMS_PER_VIEWHow many items are visible in the scroll viewport.
itemHeightnumberPer-item row height (px). If omitted, size/CSS vars are used.
availableCurrenciesCurrencyCode[]Optional allowlist of currencies to display.
animationNamestringCustom CSS animation name for list transitions.
reversebooleanfalseReverses list order.
needFormatbooleantrueWhether to live-format typed values (e.g., thousands separators).
openBlockedbooleanfalseIf true, prevents opening the dropdown/list.
item.hideCodebooleanfalseHide the currency code (e.g., USD).
item.hideNamebooleanfalseHide the currency name (e.g., “US Dollar”).
item.hideSymbolbooleanfalseHide the currency symbol (e.g., $).

api

The api prop lets you customize how exchange rates are fetched. It accepts any subset of ApiConfig; omitted fields use the defaults.

KeyTypeDefaultDescription
cachenumber60 * 60 * 1000 (1 hour)Cache duration for fetched rates in milliseconds.
fetchOptionsRequestInit{}Extra options passed to fetch (headers, credentials, etc.).
disabledbooleanfalseIf true, disables automatic API requests.
url.basestring"https://open.er-api.com/v6/latest"Base URL used for loading exchange rates.
url.builder(url: string, code?: CurrencyCode)`(url, code) => \
`${url}/${code}``Function to build the final request URL from the base URL and currency code.
setter(response: any, mutable: Ref<ApiData>) => voidbuilt‑in mapper for the default APIMaps the raw API response into the internal ApiData structure.