Cnippet

Select

Forms 5

About

A styled select dropdown for choosing a single option from a list, with a trigger, searchable popup, scroll arrows, grouping, and keyboard navigation.

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 {
  Select,
  SelectItem,
  SelectPopup,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select";

const timezones = [
  { label: "Select timezone", value: null },
  { label: "Pacific Time (PT)", value: "america/los_angeles" },
  { label: "Mountain Time (MT)", value: "america/denver" },
  { label: "Central Time (CT)", value: "america/chicago" },
  { label: "Eastern Time (ET)", value: "america/new_york" },
  { label: "Greenwich Mean Time (GMT)", value: "europe/london" },
  { label: "Central European Time (CET)", value: "europe/paris" },
  { label: "India Standard Time (IST)", value: "asia/kolkata" },
  { label: "Japan Standard Time (JST)", value: "asia/tokyo" },
];

export default function Component() {
  return (
    <Select items={timezones}>
      <SelectTrigger className="w-64">
        <SelectValue />
      </SelectTrigger>
      <SelectPopup>
        {timezones.slice(1).map((tz) => (
          <SelectItem key={tz.value} value={tz}>
            {tz.label}
          </SelectItem>
        ))}
      </SelectPopup>
    </Select>
  );
}

Dependencies

More by Cnippet

View all
  • Team

    Team

    1.3K
  • Davincho Hero-1

    Davincho Hero-1

    683
  • Aero Hero-3

    Aero Hero-3

    559
  • Features

    Features

    510
  • Random Letter Swap Navigation

    Random Letter Swap Navigation

    487
  • Services with Animated Hover Modal

    Services with Animated Hover Modal

    465
  • Blogs

    Blogs

    396
  • Aero Hero-1

    Aero Hero-1

    356

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 1

    Login 1

    52
  • Book A Demo 3

    Book A Demo 3

    83
  • Authentication Card

    Authentication Card

    47
  • Book A Demo 1

    Book A Demo 1

    69
  • Contact Card

    Contact Card

    1K
  • Login Card

    Login Card

    32
  • Login 2

    Login 2

    7