Navegaciónlanguagepickeri18n
Language Picker Pill
Selector compacto de idioma en píldora con indicador de bandera y código de idioma.
Vista Previa en Vivo
EN
ESFRJP
Uso
Copia y pega este código directamente en tu componente React:
tsx
import { LangSwitcherPill } from 'react-component-kit-ui/navigation';
<LangSwitcherPill>Content</LangSwitcherPill>Instalación Manual
Si no estás usando el paquete npm, crea un archivo nuevo y pega el siguiente código: src/components/LangSwitcherPill.tsx + LangSwitcherPill.css:
LangSwitcherPill.tsx
'use client';
import './LangSwitcherPill.css';
/** LangSwitcherPill — ported from astro-component-kit. */
export interface LangSwitcherPillProps {
}
export function LangSwitcherPill({}: LangSwitcherPillProps) {
return (
<>
<div className="lang-pill" data-rk-c3a6ea="">
<span className="curr" data-rk-c3a6ea="">EN</span>
<div className="list" data-rk-c3a6ea="">
<span data-rk-c3a6ea="">ES</span>
<span data-rk-c3a6ea="">FR</span>
<span data-rk-c3a6ea="">JP</span>
</div>
</div>
</>
);
}
export default LangSwitcherPill;LangSwitcherPill.css
/* LangSwitcherPill — ported from astro-component-kit (navigation/LangSwitcherPill.astro) */
.lang-pill:where([data-rk-c3a6ea]) { background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 100px; color: #fff; font-size: 0.75rem; font-weight: 800; border: 1px solid rgba(255, 255, 255, 0.1); cursor: pointer; position: relative; }
.list:where([data-rk-c3a6ea]) { position: absolute; top: 110%; left: 0; background: #111; border-radius: 8px; border: 1px solid #333; display: none; flex-direction: column; z-index: 10; }
.lang-pill:hover:where([data-rk-c3a6ea]) .list:where([data-rk-c3a6ea]) { display: flex; }
.list:where([data-rk-c3a6ea]) span:where([data-rk-c3a6ea]) { padding: 5px 15px; }
.list:where([data-rk-c3a6ea]) span:hover:where([data-rk-c3a6ea]) { background: #6366f1; }Información Rápida
- Categoría
- Navegación
- Nombre de archivo
LangSwitcherPill.tsx- Dependencias
- Ninguna — React + CSS puro
- Etiquetas
- languagepickeri18n