klyv-ui

Select

Forms

About

An accessible dropdown select with listbox keyboard semantics, used to choose one value from a list of labeled options such as a currency or category picker.

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 { Select } from "@/components/ui/select";
import type { SelectOption } from "@/components/ui/select";
import { useState } from "react";

const currencies: SelectOption[] = [
  { value: "usd", label: "USD", leading: <span aria-hidden="true">πŸ‡ΊπŸ‡Έ</span> },
  { value: "eur", label: "EUR", leading: <span aria-hidden="true">πŸ‡ͺπŸ‡Ί</span> },
  { value: "gbp", label: "GBP", leading: <span aria-hidden="true">πŸ‡¬πŸ‡§</span> },
  { value: "jpy", label: "JPY", leading: <span aria-hidden="true">πŸ‡―πŸ‡΅</span> },
];

const categories: SelectOption[] = [
  { value: "subscriptions", label: "Subscriptions", hint: "Recurring charges" },
  { value: "invoices", label: "Invoices", hint: "One-off bills" },
  { value: "reports", label: "Reports", hint: "Monthly summaries" },
];

export default function SelectDemo() {
  const [currency, setCurrency] = useState("usd");
  const [category, setCategory] = useState("subscriptions");

  return (
    <div className="flex min-h-[220px] w-full flex-wrap items-center justify-center gap-6 bg-background p-10 text-foreground">
      <Select
        options={currencies}
        value={currency}
        onValueChange={setCurrency}
        label="Currency"
        variant="pill"
      />
      <Select
        options={categories}
        value={category}
        onValueChange={setCategory}
        label="Category"
        variant="field"
      />
    </div>
  );
}

More by klyv-ui

View all
  • Gantt Chart

    Gantt Chart

    56
  • Klyv Animated Beam

    Klyv Animated Beam

    47
  • Pareto Chart

    Pareto Chart

    40
  • Shader Canvas

    Shader Canvas

    35
  • Sunburst Chart

    Sunburst Chart

    23
  • Morphing Text

    Morphing Text

    21
  • Gooey Loader

    Gooey Loader

    20
  • Gravity Tags

    Gravity Tags

    17

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 1

    Login 1

    52
  • Authentication Card

    Authentication Card

    47
  • Book A Demo 3

    Book A Demo 3

    83
  • Book A Demo 1

    Book A Demo 1

    69
  • Contact Card

    Contact Card

    1K
  • Login Card

    Login Card

    32
  • Login 2

    Login 2

    7