CountryCodeSelect
Installation
Section titled “Installation”npm install @sk-web-gui/reactAnvändning
Section titled “Användning”import { CountryCodeSelect } from '@sk-web-gui/react';| Prop | Typ | Standard | Beskrivning |
|---|---|---|---|
onChangeCountryCode | (value: number | undefined) => void | – | Returns the country code as a number (e.g 46). onChange will hold the selected country’s 2 digit ISO code (e.g SE). This is important to differentiate between countries with the same country code (e.g 1 for US and CA). |
onChange | (event: React.ChangeEvent<HTMLSelectElement>) => void | – | The event value holds the selected country’s 2 digit ISO code (e.g SE) followed by a + and the country code Resulting in a string like “SE+46” |
value | string | – | The selected country’s 2 digit ISO code (e.g SE) |
placeholder | string | – | Text displayed when no country is selected |
countries | string[] | – | Countries to be displayed in the select dropdown as an array of 2 digit ISO codes, e.g [SE, NO, FI] @default all countries |
Storyvarianter
Section titled “Storyvarianter”- Template – standardstory
- Combobox – standardstory
- InputWithSelect – standardstory
- InputWithCombobox – standardstory
- Implementation: @sk-web-gui/countrycode-select
- Storybook: CountryCodeSelect