Skip to content

Language Switch

Links to the translated versions of a page, as “EN / DE / FR” text, a segmented pill or a globe menu. Sets hrefLang, lang and aria-current for you.

Installation

pnpm dlx shadcn@latest add @portfolio-kit/language-switch
First time? Add the @portfolio-kit registry to components.json
components.json
{
  "registries": {
    "@portfolio-kit": "https://www.parthjadhav.com/products/portfolio-kit/r/{name}.json"
  }
}

Usage

Examples

Segmented

The current language filled in a pill, for footers and settings rows.

Menu

A globe button that lists native names, for four or more languages. children replaces a code, e.g. for scripts.

API Reference