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 toppings = [
  "Pepperoni",
  "Mushrooms",
  "Onions",
  "Olives",
  "Peppers",
  "Bacon",
  "Pineapple",
];

export default function SelectMultiple() {
  const [value, setValue] = React.useState<string[]>([
    "Pepperoni",
    "Mushrooms",
  ]);

  return (
    <div className="w-full max-w-70">
      <Select
        multiple
        value={value}
        onValueChange={(v) => setValue(v as string[])}
      >
        <SelectTrigger clearable aria-label="Choose toppings">
          <SelectValue placeholder="Choose toppings">
            {(selected: string[]) =>
              selected.length === 0
                ? "Choose toppings"
                : selected.length === 1
                  ? selected[0]
                  : `${selected.length} toppings`
            }
          </SelectValue>
        </SelectTrigger>
        <SelectContent>
          {toppings.map((topping) => (
            <SelectItem key={topping} value={topping}>
              {topping}
            </SelectItem>
          ))}
        </SelectContent>
      </Select>
    </div>
  );
}

Dependencies

More by appica-dev

View all
  • Border Beam

    Border Beam

    85
  • Carousel

    Carousel

    25
  • Text Animate

    Text Animate

    24
  • Avatar

    Avatar

    19
  • Table of Contents

    Table of Contents

    10
  • Sparkline

    Sparkline

    10
  • Background Pattern

    Background Pattern

    9
  • Color Area

    Color Area

    7

More in Forms

View all
  • Form

    Form

    6
  • Premium Auth

    Premium Auth

    607
  • Contact Form

    Contact Form

    29
  • Book A Demo 1

    Book A Demo 1

    95
  • Card Studio

    Card Studio

    48
  • Contact Card

    Contact Card

    1.1K
  • Login 2

    Login 2

    16
  • Book A Demo 3

    Book A Demo 3

    106