Magoo Component UI logo Magoo Component UI
← Catalog

Translate Bar

translate-bar molecule experimental

A compact language-selection strip — a globe icon and a row of language buttons, with the current language highlighted.

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default
Spanish

Props

NameTypeReq
languages array ✓
current string ✓

Related components

How to use

behavior.js wires the interaction: clicking a language button sets data-current="true" (and aria-pressed) on it, clears the others, and dispatches a bubbling CustomEvent "lang:change" with detail { code, label }. Config comes from each button's data-code / data-label / data-current attributes — the portable self-init passes no props. The current highlight is pure CSS (data-[current=true]) so it renders correctly before the script runs and in screenshots.

Use cases

bannerlist WCAG AA SEO 30 dir: both ai-generated