shadcn.io is not affiliated with official shadcn/ui
Language Selector Footer Block for React
A footer for a meeting-notes tool whose segmented control (EN, FR, DE, ES) rewrites the footer's own words, with three link groups and a legal row.
Installation
Overview
A footer that speaks four languages for React with Base UI. At the start, the wordmark and a one-sentence tagline; at the end, three groups of links in a nav labelled Footer. A band across the foot holds a globe icon and a segmented control with four languages (EN, FR, DE, ES) at the start, and the copyright, the policies and "All rights reserved" at the end. Choosing a language rewrites every word of the footer from one typed dictionary, marks each rewritten part with its lang, and says "Language: Français" in a polite live line. The tagline's cell is as tall as the longest version, so nothing moves under the pointer. The page's rails and top rule come from the Guides spine, and the band's rule is drawn by Guides too, with none under it because a footer ends the page. It's built from Segment Group and Guides, with your theme's tokens for every colour.
FAQ
How do I add a language or change a string?
Edit TRANSLATIONS at the top of the file: each entry is a language's code, its own name, the tagline, the three groups (a title and four link labels each), the two policies and the rights line. Add an entry and a fourth segment appears in the control, in the order of the array. Every language needs the same number of groups and links, because the footer is drawn from the selected entry alone.
Does it translate the page, or only the footer?
Only the footer: the choice lives in this block's own state and changes the words it draws. It does not reload the page, set a cookie or change your site's locale. To make it a real language switch, call your router's locale change (or set the cookie your server reads) inside the choose handler and keep the dictionary for the footer's strings.
What does lang do on the rewritten parts?
lang do on the rewritten parts?Each rewritten heading, link, sentence and the tagline carries lang with the language's code, so a screen reader switches pronunciation for that text and the browser hyphenates and picks fonts for it. The control's own label stays in English, because the person using it may not read the language they just chose, and each segment has a visually hidden name in its own language ("Français", "Deutsch").
What does a screen reader say when I change language?
A live line that exists from the start and is empty until the first change says "Language: Français" once, politely. It never speaks on load. The segments are real radio buttons, so Tab reaches the group, the arrow keys move between the languages and a screen reader hears "English, radio button, 1 of 4".
Related
- Pro
Multilingual Footer
PreferencesA footer for a help-desk inbox whose Select of six languages rewrites its words and flips it to right-to-left when Arabic is chosen.
- Pro
Localization Footer
PreferencesA footer for a payroll tool with a country Select and a currency Select beside a price sample that is reformatted as you choose.
- Pro
Link Columns Footer
Link gridsThe classic link-column footer for an email API: a brand column with the wordmark, one sentence and four social links, four groups of links behind a split divider, and a legal band with the copyright and the policy links.
- Pro
A language pill for a travel-guide site: a globe, "Guides in" and a button naming the current language, opening a popover of six languages written in their own scripts.
- Pro
Multi-Language FAQ
Reading and sharingAn FAQ in English, Spanish and Arabic for a relocation service: a language switcher swaps the title, questions and answers, and sets lang and dir so Arabic lays the block out from its end.
- Pro
Theme Toggle Footer
PreferencesA slim footer for a design-token editor with a theme button that cycles light, dark and system and really changes the page's theme.