Skip to Content
zjkm-ui
Components

Inline Select

A select that sits inside a sentence.

Email me about new components.

Props
<InlineSelect aria-label="How often">
  <option>weekly</option>
</InlineSelect>

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/inline-select.json
import { 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

PropTypeDefaultDescription
aria-labelstringNames the select. Required.
childrenReactNodeYour <option>s.
...propsselect propsEvery native <select> prop.

It has no animation, so reduced motion changes nothing.

On this page