Origin UI

Select

Forms 9

About

Enhanced shadcn/ui select

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Select to your project and fits it to your theme.

Code

How Select is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { Label } from "@/components/ui/label";
import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select";
import { RiGatsbyLine, RiNextjsLine, RiReactjsLine } from "@remixicon/react";
import { useId } from "react";

function Component() {
  const id = useId();
  return (
    <div className="space-y-2 min-w-[300px]">
      <Label htmlFor={id}>Options with icon</Label>
      <Select defaultValue="3">
        <SelectTrigger
          id={id}
          className="[&>span]:flex [&>span]:items-center [&>span]:gap-2 [&>span_svg]:shrink-0 [&>span_svg]:text-muted-foreground/80"
        >
          <SelectValue placeholder="Select framework" />
        </SelectTrigger>
        <SelectContent className="[&_*[role=option]>span>svg]:shrink-0 [&_*[role=option]>span>svg]:text-muted-foreground/80 [&_*[role=option]>span]:flex [&_*[role=option]>span]:gap-2">
          <SelectItem value="1">
            <RiReactjsLine size={16} aria-hidden="true" />
            <span className="truncate">React</span>
          </SelectItem>
          <SelectItem value="2">
            <RiNextjsLine size={16} aria-hidden="true" />
            <span className="truncate">Next.js</span>
          </SelectItem>
          <SelectItem value="3">
            <RiGatsbyLine size={16} aria-hidden="true" />
            <span className="truncate">Gatsby</span>
          </SelectItem>
        </SelectContent>
      </Select>
    </div>
  );
}

export { Component };

Dependencies

More by Origin UI

View all
  • Dialog

    Dialog

    1.3K
  • Avatar

    Avatar

    1K
  • useImageUpload

    useImageUpload

    946
  • usePagination

    usePagination

    634
  • Popover

    Popover

    389
  • Button

    Button

    379
  • Command

    Command

    343
  • Calendar [React Day Picker]

    Calendar [React Day Picker]

    270

More in Forms

View all
  • Authentication Card

    Authentication Card

    51
  • Contact Card

    Contact Card

    1.1K
  • Premium Auth

    Premium Auth

    560
  • Book A Demo 1

    Book A Demo 1

    88
  • Modern & Stunning sign in

    Modern & Stunning sign in

    1.7K
  • Form

    Form

    139
  • SignInPage

    SignInPage

    741
  • Card Studio

    Card Studio

    46