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

    63
  • Text Animate

    Text Animate

    21
  • Carousel

    Carousel

    19
  • Avatar

    Avatar

    15
  • Sparkline

    Sparkline

    8
  • Table of Contents

    Table of Contents

    7
  • Color Area

    Color Area

    6
  • Background Pattern

    Background Pattern

    6

More in Forms

View all
  • Premium Auth

    Premium Auth

    549
  • Contact Card

    Contact Card

    1.1K
  • Login 2

    Login 2

    10
  • Form

    Form

    17
  • Form

    Form

    20
  • Login 1

    Login 1

    59
  • SignInPage

    SignInPage

    720
  • Book A Demo 3

    Book A Demo 3

    95