# Language Select

> A compact language switcher: a native select with a globe icon on the left and a chevron on the right.

- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: language, locale, select, globe icon, i18n, footer
- Live preview: https://copy-css.com/snippets/language-select
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<label class="lang-select">
  <span class="lang-select-sr">Language</span>
  <svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg>
  <select name="lang">
    <option value="en" selected>English</option>
    <option value="de">Deutsch</option>
    <option value="es">Español</option>
    <option value="ja">日本語</option>
  </select>
</label>
```

## CSS

```css
.lang-select {
  position: relative;
  display: inline-block;
  font-family: system-ui, sans-serif;
}

.lang-select-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lang-select svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
  transform: translateY(-50%);
  pointer-events: none;
}

.lang-select select {
  padding: 8px 32px 8px 36px;
  border: 1px solid #334155;
  border-radius: 999px;
  background: #1e293b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
  color: #e2e8f0;
  font: 500 14px system-ui, sans-serif;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.lang-select select:hover {
  border-color: #475569;
}

.lang-select select:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.lang-select option {
  background: #1e293b;
  color: #e2e8f0;
}
```

## Notes

- This CSS Language Select is 53 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transforms, clip paths and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
