Skip to content

Block 104 of 297

Language Links

Links to translated versions of a page, each named in its own language with correct lang and hreflang.

Puck key
LanguageLinksBlock
Export
languageLinksBlock
React component
<LanguageLinks />
Path
components/puck/language-links-block.tsx
Dependencies
None
License
MIT

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

Links to translated versions of the current page, with each language written in its own script and an optional English name underneath. Choose a card grid for a full section or a slim bar for the top or bottom of a page. Right-to-left languages such as Arabic and Hebrew are set to read right to left automatically.

  • Vital information pages that are translated into several languages
  • City and county service pages that serve multilingual communities
  • Health, legal aid or school enrollment pages with translated forms
Writing the content
  • Write Name in that language the way speakers write it, such as Español, 中文 or العربية, not the English spelling.
  • Always fill Language code (es, vi, zh-Hans, ar). It controls pronunciation, text direction and the hreflang hint.
  • Point each Link at the translated version of this same page, not a general translated home page.
  • Intro shows in the cards layout only; use it to explain how to request an interpreter.
Accessibility
  • Each native name carries a lang attribute so screen readers switch pronunciation (WCAG 3.1.2), and links set hreflang to signal the target language.
  • Right-to-left codes get dir="rtl" on the name, which keeps punctuation and ordering correct.
  • The slim bar is a nav landmark labelled by the heading, or "Other languages" when there is no heading. Links have a 44px minimum height and a focus outline.
Customizing the code
  • The rtl set near the top lists language codes treated as right to left. Add codes there if you need others.
  • Cards are sm:grid-cols-2 lg:grid-cols-3, and the link color is indigo-700 in both layouts.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Headingtext
  • Heading levelselect
  • Introtextarea
  • Layoutradio
  • Languagesarray