Components
Inline Select
A select that sits inside a sentence.
Email me about new components.
<InlineSelect aria-label="How often">
<option>weekly</option>
</InlineSelect>Installation
npx shadcn@latest add https://ui.zjkm.tech/r/inline-select.jsonimport { InlineSelect } from "@/components/inline-select"Using JavaScript? Set tsx: false in components.json and the CLI converts it.
New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.
Usage
A native select styled to sit inside a sentence, for settings that read naturally: "Email me weekly about new components". The sentence around it isn't a label, so give it an aria-label.
import { InlineSelect } from "@/components/inline-select";
export function Digest() {
return (
<p>
Email me{" "}
<InlineSelect aria-label="How often" defaultValue="weekly">
<option value="daily">daily</option>
<option value="weekly">weekly</option>
</InlineSelect>{" "}
about new components.
</p>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
aria-label | string | Names the select. Required. | |
children | ReactNode | Your <option>s. | |
...props | select props | Every native <select> prop. |
It has no animation, so reduced motion changes nothing.