Reference

LocaleSwitch

One button for each of i18n.locales, each written in its own language (English, العربية), the current one pressed; a press is setLocale.

LocaleSwitch(label: String)

Since 6.2.0

No preview for this one: the example below shows how it is written.

Example

wf

Row(gap: .sm, align: .center, justify: .between) { Text("Language").bold LocaleSwitch(label: "Language") }

Related:

ThemeToggle

Props

Props of LocaleSwitch
PropTypeUnsetMeaning

label:

String

Language

The group's accessible name; the group draws one button per i18n.locales entry, and nothing with fewer than two

Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.

Flags and cases

A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.

No flags of its own.

Events

Every element also takes the props, the events and the attribute families listed on every element.

Slots

It takes no slots.

Renders with the class wf-locale-switch, stable across releases, so a stylesheet may target it.

These controls list the props' cases; the example below shows them written.