appica-dev

Select

Forms

About

A dropdown select control with a styled trigger and popup listbox for choosing one or multiple options from a list.

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

"use client";

import * as React from "react";
import {
  Select,
  SelectTrigger,
  SelectValue,
  SelectContent,
  SelectItem,
} from "@/components/ui/select";

const fruits = [
  "Apple",
  "Banana",
  "Blueberry",
  "Grapes",
  "Orange",
  "Strawberry",
];

export default function SelectControlled() {
  const [value, setValue] = React.useState<string | null>(null);

  return (
    <div className="flex w-full max-w-70 flex-col gap-3">
      <Select value={value} onValueChange={(v) => setValue(v as string | null)}>
        <SelectTrigger clearable aria-label="Pick a fruit">
          <SelectValue placeholder="Pick a fruit" />
        </SelectTrigger>
        <SelectContent>
          {fruits.map((fruit) => (
            <SelectItem key={fruit} value={fruit}>
              {fruit}
            </SelectItem>
          ))}
        </SelectContent>
      </Select>
      <p className="text-foreground-muted text-sm">
        Current value:{" "}
        <span className="text-foreground font-medium">{value ?? "-"}</span>
      </p>
    </div>
  );
}

Dependencies

More by appica-dev

View all
  • Border Beam

    Border Beam

    63
  • Text Animate

    Text Animate

    21
  • Carousel

    Carousel

    19
  • Avatar

    Avatar

    15
  • Sparkline

    Sparkline

    8
  • Table of Contents

    Table of Contents

    7
  • Background Pattern

    Background Pattern

    7
  • Color Area

    Color Area

    6

More in Forms

View all
  • Premium Auth

    Premium Auth

    551
  • Contact Card

    Contact Card

    1.1K
  • Login 2

    Login 2

    10
  • Form

    Form

    17
  • Form

    Form

    20
  • Book A Demo 3

    Book A Demo 3

    96
  • Login 1

    Login 1

    59
  • SignInPage

    SignInPage

    721