Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Multilingual Footer Block for React

A 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.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A footer that changes language and reading direction for React with Base UI. A brand cell and three groups of links (a nav labelled Footer) sit in cells with shared hairlines, and a legal row under them carries the copyright and the policies at the start and a Select of six languages at the end, each named in its own script: English, Español, Deutsch, 日本語, العربية, Português. Choosing one rewrites the tagline, the group titles, the links and the legal row, marks them with their lang and says so in a polite live line. Choosing Arabic also sets dir="rtl" on the footer and on the library's direction provider, so the cells, the legal row and the Select's list all mirror. The tagline's cell is as tall as the longest version, so choosing a language never moves the page. The rails and top rule come from the Guides spine, and the legal row's rule is drawn by Guides, with none under it because a footer ends the page.

FAQ

How do I add a language?

Add an entry to TRANSLATIONS at the top of the file: the code, the language's own name (what the Select shows), the Select's label in that language, the tagline, three groups of three links, the policies and the rights line. Set rtl: true for a right-to-left language. The Select lists the entries in array order, and nothing else in the file needs to change.

What exactly flips when I choose Arabic?

The footer element gets dir="rtl", so the brand cell moves to the end, the link cells and their text align to the start of the new direction, and the legal row puts the copyright at the right and the Select at the left. The library's direction provider is set too, because the Select's list and its keyboard handling follow it rather than the document. The wordmark stays left-to-right, since it is artwork. Choosing another language flips it back.

How is it announced?

Every rewritten part carries lang, so a screen reader pronounces it in the right language, and the Select's own entries are tagged with theirs. A live line that is empty from the start says "Language: Deutsch" once per choice. The Select is named in the current language ("Idioma", "言語"), and its list opens with the arrow keys or Enter and closes with Escape.

Does anything jump when the words change?

No. The tagline shares one grid cell with an unseen copy of every language's version, so the cell is as tall as the longest. Titles and links are one line each, and the Select has a fixed width.

Does it change my site's language?

No: the choice lives in this block and only affects the footer. To make it a real switch, call your router's locale change or set the cookie your server reads from the Select's change handler, and keep the dictionary for the footer's strings.

How does it fit on a phone?

The cells stack, one to a row and the three groups side by side from sm; the legal row stacks with the Select at full width under the policies. In Arabic it mirrors the same way, and nothing scrolls sideways at 320 pixels.

  • Pro

    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.

  • Pro

    A footer for a payroll tool with a country Select and a currency Select beside a price sample that is reformatted as you choose.

  • Pro

    The 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

    Multi-Language FAQ

    Reading and sharing

    An 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

    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

    One Row Footer

    Slim and minimal

    The smallest footer: one row on the spine with a wordmark and a copyright line at the start and four inline links with a drawn underline at the end.