Skip to content

LocalePicker

Adds a language to a site by search, not by typing a code. The list is every language Intl names, in the panel language and in the language itself, and a typed BCP 47 tag such as pt-BR, sr-Latn or yue is offered in its canonical spelling. Pick it for the languages of content; use LanguagePicker for the language of the interface.

  • LocalePicker
Status
Stable
axe:
Light, Dark, High contrast
Unit tests:
yes
Keyboard pass:
not yet
Screen reader pass:
not yet
Used in:
no app yet

PreviewLink to the section Preview

Live in all three themes. Everything here is interactive.

Light theme, LocalePicker

Abkhazianab
Afaraa
Afrikaansaf
Akanak
Akantw
Albanianshqipsq
Amharicአማርኛam
ArabicالعربيةRight to leftar
Aragonesean
Armenianհայերենhy
Assameseঅসমীয়াas
Avaricav
AvestanRight to leftae
Aymaraay
Azerbaijaniazərbaycanaz
Bambarabamanakanbm
Banglaবাংলাbn
Bashkirбашҡортba
Basqueeuskaraeu
Belarusianбеларускаяbe
Bhojpuribh
Bislamabi
Bosnianbosanskibs
Bretonbrezhonegbr
Bulgarianбългарскиbg
Burmeseမြန်မာmy
Catalancatalàca
Chamorroch
Chechenнохчийнce
Chinese中文zh

153 more, keep typing to narrow the list

Languages of the site: pl, en

Dark theme, LocalePicker

Abkhazianab
Afaraa
Afrikaansaf
Akanak
Akantw
Albanianshqipsq
Amharicአማርኛam
ArabicالعربيةRight to leftar
Aragonesean
Armenianհայերենhy
Assameseঅসমীয়াas
Avaricav
AvestanRight to leftae
Aymaraay
Azerbaijaniazərbaycanaz
Bambarabamanakanbm
Banglaবাংলাbn
Bashkirбашҡортba
Basqueeuskaraeu
Belarusianбеларускаяbe
Bhojpuribh
Bislamabi
Bosnianbosanskibs
Bretonbrezhonegbr
Bulgarianбългарскиbg
Burmeseမြန်မာmy
Catalancatalàca
Chamorroch
Chechenнохчийнce
Chinese中文zh

153 more, keep typing to narrow the list

Languages of the site: pl, en

High contrast theme, LocalePicker

Abkhazianab
Afaraa
Afrikaansaf
Akanak
Akantw
Albanianshqipsq
Amharicአማርኛam
ArabicالعربيةRight to leftar
Aragonesean
Armenianհայերենhy
Assameseঅসমীয়াas
Avaricav
AvestanRight to leftae
Aymaraay
Azerbaijaniazərbaycanaz
Bambarabamanakanbm
Banglaবাংলাbn
Bashkirбашҡортba
Basqueeuskaraeu
Belarusianбеларускаяbe
Bhojpuribh
Bislamabi
Bosnianbosanskibs
Bretonbrezhonegbr
Bulgarianбългарскиbg
Burmeseမြန်မာmy
Catalancatalàca
Chamorroch
Chechenнохчийнce
Chinese中文zh

153 more, keep typing to narrow the list

Languages of the site: pl, en

UsageLink to the section Usage

tsx
import { LocalePicker } from '@skribly/ui/navigation'
tsx
<LocalePicker label={t('languages.add')} displayLocale={panelLocale} emptyLabel={t('languages.none')}
  disabledLocales={site.locales} disabledLabel={t('languages.added')} rtlLabel={t('languages.rtl')}
  moreLabel={(hidden) => t('languages.more', { hidden })} onChange={(tag, option) => addLocale(tag, option.direction)} />

Every label is a prop, so the app passes its own words in its own language. See no built-in text.

AccessibilityLink to the section Accessibility

  • The search field filters the list as you type; Up and Down move through the matches and Enter picks one while focus stays in the field.
  • The name in the language itself carries its lang and dir.
  • A right-to-left language and a language already added say so in words, never colour alone, and an added one is disabled.
  • The list scrolls inside its own box and shows at most limit matches, with a line that says how many more there are.

This demo runs through axe in all three themes on every test run. See what the tests check.

Search this site

Arrows move through the results, Enter opens one, Esc closes. Ctrl K /