# Inline Sort Select

> A borderless "Sort by" select that reads like part of the sentence, for product lists and search results.

- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: sort by, select, inline, filter, toolbar, minimal
- Live preview: https://copy-css.com/snippets/inline-sort-select
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<label class="sort-by">
  Sort by
  <select name="sort">
    <option>Newest</option>
    <option>Price: low to high</option>
    <option>Price: high to low</option>
    <option>Best rated</option>
  </select>
</label>
```

## CSS

```css
.sort-by {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #71717a;
  font: 14px system-ui, sans-serif;
}

.sort-by select {
  padding: 4px 22px 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318181b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center / 12px;
  color: #18181b;
  font: 600 14px system-ui, sans-serif;
  -webkit-appearance: none;
  appearance: none;
  field-sizing: content;
  cursor: pointer;
}

.sort-by select:hover {
  background-color: #f4f4f5;
}

.sort-by select:focus-visible {
  outline: 2px solid #18181b;
  outline-offset: 1px;
}
```

## Notes

- This CSS Inline Sort Select is 29 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses field-sizing, Flexbox and keyboard focus styles.
- field-sizing: Chrome and Edge 123+ and Safari 26.2+. Firefox support is very recent; older browsers keep the field at a fixed size.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
