Tailwind UI Pattern Registry for humans and agents

code tabs language switcher curl python typescript api documentation code tabs language switcher curl python typescript api sdk documentation multi-language code switcher tabbed code block with language selection API code example with cURL Python TypeScript tabs

Code Language Switcher

Fetch pattern JSON: curl https://webspire.de/patterns/code-preview/language-switcher.json

Details

Family
code-preview
Tier
enhanced
Kind
component
Extends
code-preview/base
Responsive Dark Mode Tailwind Only SSR Safe Copy & Paste
Stable Published
codetabslanguageswitchercurlpythontypescriptapidocumentation

Slots

Name Required Description
tabs Yes Language tab labels (cURL, Python, TypeScript, Go, etc.)
panels Yes Code panel per language — shown/hidden via CSS peer-checked.

Dark code block with a tab bar for switching between cURL, Python, and TypeScript examples. Tab switching is CSS-only using <input type="radio"> + peer-checked — no JavaScript. Each tab panel uses hidden peer-checked/[name]:block to show/hide. The copy button is a visual placeholder; wire up the Clipboard API for production use.