select-01
Loading...
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const items = [
{ label: "Select a fruit", value: null },
{ label: "Apple", value: "apple" },
{ label: "Banana", value: "banana" },
{ label: "Blueberry", value: "blueberry" },
{ label: "Grapes", value: "grapes" },
{ label: "Pineapple", value: "pineapple" },
]
export function SelectDemo() {
return (
<Select items={items}>
<SelectTrigger className="w-full max-w-48">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
{items.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectGroup>
</SelectContent>
</Select>
)
}select-02
Loading...
"use client"
import * as React from "react"
import {
Field,
FieldContent,
FieldDescription,
FieldGroup,
FieldLabel,
} from "@/components/ui/field"
import { Label } from "@/components/ui/label"
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { Switch } from "@/components/ui/switch"
const items = [
{ label: "Select a fruit", value: null },
{ label: "Apple", value: "apple" },
{ label: "Banana", value: "banana" },
{ label: "Blueberry", value: "blueberry" },
{ label: "Grapes", value: "grapes" },
{ label: "Pineapple", value: "pineapple" },
]
export function SelectAlignItem() {
const [alignItemWithTrigger, setAlignItemWithTrigger] = React.useState(true)
return (
<FieldGroup className="w-full max-w-xs">
<Field orientation="horizontal">
<FieldContent>
<FieldLabel htmlFor="align-item">Align Item</FieldLabel>
<FieldDescription>
Toggle to align the item with the trigger.
</FieldDescription>
</FieldContent>
<Switch
id="align-item"
checked={alignItemWithTrigger}
onCheckedChange={setAlignItemWithTrigger}
/>
</Field>
<Field>
<Select items={items} defaultValue="banana">
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent alignItemWithTrigger={alignItemWithTrigger}>
<SelectGroup>
{items.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectGroup>
</SelectContent>
</Select>
</Field>
</FieldGroup>
)
}select-03
Loading...
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
export function SelectGroups() {
const fruits = [
{ label: "Apple", value: "apple" },
{ label: "Banana", value: "banana" },
{ label: "Blueberry", value: "blueberry" },
]
const vegetables = [
{ label: "Carrot", value: "carrot" },
{ label: "Broccoli", value: "broccoli" },
{ label: "Spinach", value: "spinach" },
]
const allItems = [
{ label: "Select a fruit", value: null },
...fruits,
...vegetables,
]
return (
<Select items={allItems}>
<SelectTrigger className="w-full max-w-48">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
{fruits.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Vegetables</SelectLabel>
{vegetables.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectGroup>
</SelectContent>
</Select>
)
}select-04
Loading...
import {
Globe as GlobeIcon,
} from "@designali/icons"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const regions = [
{
label: "Americas",
zones: [
{ label: "Los Angeles", value: "america-la", offset: "UTC-8" },
{ label: "Chicago", value: "america-chicago", offset: "UTC-6" },
{ label: "New York", value: "america-ny", offset: "UTC-5" },
{ label: "Sao Paulo", value: "america-sp", offset: "UTC-3" },
],
},
{
label: "Europe",
zones: [
{ label: "London", value: "europe-london", offset: "UTC+0" },
{ label: "Berlin", value: "europe-berlin", offset: "UTC+1" },
{ label: "Athens", value: "europe-athens", offset: "UTC+2" },
],
},
{
label: "Asia Pacific",
zones: [
{ label: "Dubai", value: "asia-dubai", offset: "UTC+4" },
{ label: "Singapore", value: "asia-singapore", offset: "UTC+8" },
{ label: "Tokyo", value: "asia-tokyo", offset: "UTC+9" },
{ label: "Sydney", value: "australia-sydney", offset: "UTC+10" },
],
},
]
const items = regions.flatMap((region) => region.zones)
export function TimezoneSelect() {
return (
<Field className="w-full max-w-xs">
<FieldLabel htmlFor="timezone">Timezone</FieldLabel>
<Select items={items} defaultValue="europe-berlin">
<SelectTrigger id="timezone" className="w-full">
<GlobeIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent>
{regions.map((region, index) => (
<SelectGroup key={region.label}>
{index > 0 && <SelectSeparator />}
<SelectLabel>{region.label}</SelectLabel>
{region.zones.map((zone) => (
<SelectItem key={zone.value} value={zone.value}>
{zone.label}
<span className="ms-auto text-muted-foreground tabular-nums">
{zone.offset}
</span>
</SelectItem>
))}
</SelectGroup>
))}
</SelectContent>
</Select>
<FieldDescription>
Used for scheduled reports and reminders.
</FieldDescription>
</Field>
)
}
select-05
Loading...
import {
ListFilter as ListFilterIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const statuses = [
{ label: "Any status", value: "any" },
{ label: "Open", value: "open" },
{ label: "In review", value: "review" },
{ label: "Closed", value: "closed" },
]
const owners = [
{ label: "Anyone", value: "anyone" },
{ label: "Me", value: "me" },
{ label: "Unassigned", value: "unassigned" },
]
const ranges = [
{ label: "This week", value: "week" },
{ label: "This month", value: "month" },
{ label: "This quarter", value: "quarter" },
]
export function CompactFilterBar() {
return (
<div className="flex w-full max-w-md flex-wrap items-center gap-2 border bg-muted/30 p-2">
<ListFilterIcon className="size-4 text-muted-foreground" />
<Select items={statuses} defaultValue="any">
<SelectTrigger size="sm" aria-label="Status">
<SelectValue />
</SelectTrigger>
<SelectContent>
{statuses.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<Select items={owners} defaultValue="me">
<SelectTrigger size="sm" aria-label="Owner">
<SelectValue />
</SelectTrigger>
<SelectContent>
{owners.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<Select items={ranges} defaultValue="month">
<SelectTrigger size="sm" aria-label="Date range">
<SelectValue />
</SelectTrigger>
<SelectContent>
{ranges.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<Button variant="ghost" size="sm" className="ms-auto">
Reset
</Button>
</div>
)
}
select-06
Loading...
import {
Lock as LockIcon,
} from "@designali/icons"
import { Badge } from "@/components/ui/badge"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const retention = [
{ label: "30 days", value: "30" },
{ label: "90 days", value: "90" },
{ label: "1 year", value: "365" },
]
export function DisabledPlanSelect() {
return (
<Field className="w-full max-w-xs">
<div className="flex items-center justify-between">
<FieldLabel htmlFor="retention">Log retention</FieldLabel>
<Badge variant="secondary">
<LockIcon />
Pro
</Badge>
</div>
<Select items={retention} defaultValue="30" disabled>
<SelectTrigger id="retention" className="w-full">
<SelectValue />
</SelectTrigger>
<SelectContent>
{retention.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<FieldDescription>
Upgrade to Pro to keep logs for up to a year.
</FieldDescription>
</Field>
)
}
select-07
Loading...
"use client"
import * as React from "react"
import { Button } from "@/components/ui/button"
import { Field, FieldError, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const departments = [
{ label: "Engineering", value: "engineering" },
{ label: "Design", value: "design" },
{ label: "Marketing", value: "marketing" },
{ label: "Finance", value: "finance" },
]
export function RequiredInvalidSelect() {
const [value, setValue] = React.useState<string | null>(null)
const [touched, setTouched] = React.useState(false)
const invalid = touched && !value
return (
<form
className="flex w-full max-w-xs flex-col gap-4"
onSubmit={(event) => {
event.preventDefault()
setTouched(true)
}}
>
<Field data-invalid={invalid}>
<FieldLabel htmlFor="department">Department</FieldLabel>
<Select
items={departments}
value={value}
onValueChange={setValue}
required
>
<SelectTrigger
id="department"
className="w-full"
aria-invalid={invalid}
>
<SelectValue placeholder="Choose a department" />
</SelectTrigger>
<SelectContent>
{departments.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
{invalid && (
<FieldError>Please select a department to continue.</FieldError>
)}
</Field>
<Button type="submit">Continue</Button>
</form>
)
}
select-08
Loading...
"use client"
import * as React from "react"
import {
Monitor as MonitorIcon,
Moon as MoonIcon,
Sun as SunIcon,
} from "@designali/icons"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { cn } from "@/lib/utils"
const themes = [
{ label: "Light", value: "light", icon: SunIcon },
{ label: "Dark", value: "dark", icon: MoonIcon },
{ label: "System", value: "system", icon: MonitorIcon },
]
export function ThemePreviewSelect() {
const [theme, setTheme] = React.useState<string | null>("dark")
return (
<div className="flex w-full max-w-xs flex-col gap-3">
<div
className={cn(
"flex h-24 flex-col gap-2 border p-3",
theme === "light" && "bg-white",
theme === "dark" && "bg-foreground",
theme === "system" && "bg-linear-to-r from-white to-foreground"
)}
>
<div className="h-2 w-1/2 bg-muted-foreground/60" />
<div className="h-2 w-3/4 bg-muted-foreground/40" />
<div className="mt-auto h-5 w-16 bg-muted-foreground/70" />
</div>
<Select items={themes} value={theme} onValueChange={setTheme}>
<SelectTrigger className="w-full" aria-label="Theme">
<SelectValue />
</SelectTrigger>
<SelectContent>
{themes.map((item) => (
<SelectItem key={item.value} value={item.value}>
<item.icon />
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
)
}
select-09
Loading...
"use client"
import * as React from "react"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const skills = [
{ label: "TypeScript", value: "typescript" },
{ label: "React", value: "react" },
{ label: "Node.js", value: "node" },
{ label: "PostgreSQL", value: "postgres" },
{ label: "Figma", value: "figma" },
{ label: "Rust", value: "rust" },
]
const labelFor = (value: string) =>
skills.find((skill) => skill.value === value)?.label ?? value
export function MultipleSkillsSelect() {
const [value, setValue] = React.useState<string[]>(["typescript", "react"])
return (
<Field className="w-full max-w-xs">
<FieldLabel htmlFor="skills">Skills</FieldLabel>
<Select items={skills} multiple value={value} onValueChange={setValue}>
<SelectTrigger id="skills" className="w-full">
<SelectValue>
{(selected: string[]) =>
selected.length === 0
? "Select skills"
: selected.length <= 2
? selected.map(labelFor).join(", ")
: selected.length + " skills selected"
}
</SelectValue>
</SelectTrigger>
<SelectContent>
{skills.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<FieldDescription>
Pick the stack for your Designali project.
</FieldDescription>
</Field>
)
}
select-10
Loading...
"use client"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { cn } from "@/lib/utils"
const statuses = [
{ label: "Backlog", value: "backlog", color: "bg-muted-foreground" },
{ label: "Todo", value: "todo", color: "bg-primary" },
{ label: "In progress", value: "progress", color: "bg-primary" },
{ label: "Done", value: "done", color: "bg-primary" },
{ label: "Canceled", value: "canceled", color: "bg-destructive" },
]
export function IssueStatusSelect() {
return (
<div className="flex w-full max-w-sm items-center justify-between gap-4 border p-3">
<div className="flex min-w-0 flex-col">
<span className="text-xs text-muted-foreground">DES-482</span>
<span className="truncate text-sm font-medium">
Redesign designali.com onboarding
</span>
</div>
<Select items={statuses} defaultValue="progress">
<SelectTrigger size="sm" aria-label="Status">
<SelectValue>
{(value: string) => {
const status = statuses.find((item) => item.value === value)
return (
<>
<span className={cn("size-2 rounded-full", status?.color)} />
{status?.label}
</>
)
}}
</SelectValue>
</SelectTrigger>
<SelectContent>
{statuses.map((item) => (
<SelectItem key={item.value} value={item.value}>
<span className={cn("size-2 rounded-full", item.color)} />
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
)
}
select-11
Loading...
"use client"
import {
Minus as MinusIcon,
SignalHigh as SignalHighIcon,
SignalLow as SignalLowIcon,
SignalMedium as SignalMediumIcon,
Siren as SirenIcon,
} from "@designali/icons"
import { Field, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const priorities = [
{
label: "No priority",
value: "none",
icon: MinusIcon,
tone: "text-muted-foreground",
},
{ label: "Low", value: "low", icon: SignalLowIcon, tone: "text-primary" },
{
label: "Medium",
value: "medium",
icon: SignalMediumIcon,
tone: "text-primary",
},
{
label: "High",
value: "high",
icon: SignalHighIcon,
tone: "text-primary",
},
{ label: "Urgent", value: "urgent", icon: SirenIcon, tone: "text-destructive" },
]
export function PrioritySelectIcons() {
return (
<Field className="w-full max-w-56">
<FieldLabel htmlFor="priority">Priority</FieldLabel>
<Select items={priorities} defaultValue="high">
<SelectTrigger id="priority" className="w-full">
<SelectValue>
{(value: string) => {
const priority = priorities.find((item) => item.value === value)
if (!priority) return null
return (
<>
<priority.icon className={priority.tone} />
{priority.label}
</>
)
}}
</SelectValue>
</SelectTrigger>
<SelectContent>
{priorities.map((item) => (
<SelectItem key={item.value} value={item.value}>
<item.icon className={item.tone} />
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
)
}
select-12
Loading...
"use client"
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
import { Field, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const people = [
{
label: "Ali Imam",
value: "maya",
email: "ali@designali.com",
initials: "AI",
},
{
label: "Jonas",
value: "jonas",
email: "jonas@designali.com",
initials: "J",
},
{
label: "Priya",
value: "priya",
email: "priya@designali.com",
initials: "P",
},
{
label: "Diego",
value: "diego",
email: "diego@designali.com",
initials: "D",
},
]
export function AssigneeAvatarSelect() {
return (
<Field className="w-full max-w-xs">
<FieldLabel htmlFor="assignee">Assignee</FieldLabel>
<Select items={people} defaultValue="priya">
<SelectTrigger id="assignee" className="h-10 w-full">
<SelectValue>
{(value: string) => {
const person = people.find((item) => item.value === value)
if (!person) return null
return (
<>
<Avatar size="sm">
<AvatarFallback>{person.initials}</AvatarFallback>
</Avatar>
{person.label}
</>
)
}}
</SelectValue>
</SelectTrigger>
<SelectContent>
{people.map((item) => (
<SelectItem key={item.value} value={item.value}>
<Avatar size="sm">
<AvatarFallback>{item.initials}</AvatarFallback>
</Avatar>
<span className="flex flex-col">
<span>{item.label}</span>
<span className="text-muted-foreground">{item.email}</span>
</span>
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
)
}
select-13
Loading...
import {
CreditCard as CreditCardIcon,
Plus as PlusIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const methods = [
{ label: "Visa ending 4242", value: "visa", brand: "VISA", expires: "08/27" },
{
label: "Mastercard ending 1881",
value: "mc",
brand: "MC",
expires: "02/26",
},
{ label: "Amex ending 0005", value: "amex", brand: "AMEX", expires: "11/28" },
]
export function PaymentMethodSelect() {
return (
<div className="flex w-full max-w-sm flex-col gap-3 border p-4">
<div className="flex items-center justify-between text-sm">
<span className="font-medium">Pay with</span>
<Button variant="link" size="xs">
<PlusIcon data-icon="inline-start" />
Add card
</Button>
</div>
<Select items={methods} defaultValue="visa">
<SelectTrigger className="h-10 w-full" aria-label="Payment method">
<CreditCardIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent>
{methods.map((item) => (
<SelectItem key={item.value} value={item.value}>
<span className="flex h-5 w-9 items-center justify-center border bg-muted text-[9px] font-semibold">
{item.brand}
</span>
{item.label}
<span className="ms-auto ps-4 text-muted-foreground">
{item.expires}
</span>
</SelectItem>
))}
</SelectContent>
</Select>
<Button className="w-full">Pay $128.00</Button>
</div>
)
}
select-14
Loading...
"use client"
import * as React from "react"
import {
Truck as TruckIcon,
} from "@designali/icons"
import { Field, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const options = [
{ label: "Standard", value: "standard", eta: "5-7 business days", price: 0 },
{ label: "Express", value: "express", eta: "2-3 business days", price: 9 },
{
label: "Overnight",
value: "overnight",
eta: "Next business day",
price: 24,
},
]
const subtotal = 86
export function ShippingSpeedSelect() {
const [speed, setSpeed] = React.useState<string | null>("standard")
const shipping = options.find((option) => option.value === speed)?.price ?? 0
return (
<div className="flex w-full max-w-sm flex-col gap-3 border p-4 text-sm">
<Field>
<FieldLabel htmlFor="shipping">Shipping</FieldLabel>
<Select items={options} value={speed} onValueChange={setSpeed}>
<SelectTrigger id="shipping" className="w-full">
<TruckIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent>
{options.map((item) => (
<SelectItem key={item.value} value={item.value}>
<span className="flex flex-col">
<span>{item.label}</span>
<span className="text-muted-foreground">{item.eta}</span>
</span>
<span className="ms-auto ps-4">
{item.price === 0 ? "Free" : "$" + item.price}
</span>
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
<div className="flex justify-between text-muted-foreground">
<span>Subtotal</span>
<span>{"$" + subtotal.toFixed(2)}</span>
</div>
<div className="flex justify-between text-muted-foreground">
<span>Shipping</span>
<span>{shipping === 0 ? "Free" : "$" + shipping.toFixed(2)}</span>
</div>
<div className="flex justify-between border-t pt-3 font-medium">
<span>Total</span>
<span>{"$" + (subtotal + shipping).toFixed(2)}</span>
</div>
</div>
)
}
select-15
Loading...
"use client"
import * as React from "react"
import {
ArrowUpDown as ArrowUpDownIcon,
} from "@designali/icons"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const sorts = [
{ label: "Featured", value: "featured" },
{ label: "Price: low to high", value: "price-asc" },
{ label: "Price: high to low", value: "price-desc" },
{ label: "Name: A to Z", value: "name" },
]
const products = [
{ name: "Portfolio Simple template", price: 32, rank: 2 },
{ name: "Design Agency template", price: 24, rank: 1 },
{ name: "Resort template", price: 18, rank: 3 },
]
export function ProductSortSelect() {
const [sort, setSort] = React.useState<string | null>("featured")
const sorted = [...products].sort((a, b) => {
if (sort === "price-asc") return a.price - b.price
if (sort === "price-desc") return b.price - a.price
if (sort === "name") return a.name.localeCompare(b.name)
return a.rank - b.rank
})
return (
<div className="flex w-full max-w-sm flex-col gap-3">
<div className="flex items-center justify-between">
<span className="text-sm text-muted-foreground">
{products.length} products
</span>
<Select items={sorts} value={sort} onValueChange={setSort}>
<SelectTrigger size="sm" aria-label="Sort by">
<ArrowUpDownIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent align="end" alignItemWithTrigger={false}>
{sorts.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
<ul className="divide-y border">
{sorted.map((product) => (
<li key={product.name} className="flex justify-between p-3 text-sm">
<span>{product.name}</span>
<span className="text-muted-foreground">{"$" + product.price}</span>
</li>
))}
</ul>
</div>
)
}
select-16
Loading...
"use client"
import * as React from "react"
import {
Calendar as CalendarIcon,
} from "@designali/icons"
import { Badge } from "@/components/ui/badge"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const ranges = [
{ label: "Last 24 hours", value: "24h", visitors: "1,284", change: "+4.1%" },
{ label: "Last 7 days", value: "7d", visitors: "9,870", change: "+12.6%" },
{ label: "Last 30 days", value: "30d", visitors: "41,302", change: "-2.3%" },
{
label: "Last 12 months",
value: "12m",
visitors: "502,118",
change: "+38.0%",
},
]
export function AnalyticsRangeSelect() {
const [range, setRange] = React.useState<string | null>("7d")
const current = ranges.find((item) => item.value === range) ?? ranges[1]!
return (
<Card className="w-full max-w-sm">
<CardHeader>
<CardDescription>Unique visitors</CardDescription>
<CardTitle className="text-2xl tabular-nums">
{current.visitors}
</CardTitle>
<CardAction>
<Select items={ranges} value={range} onValueChange={setRange}>
<SelectTrigger size="sm" aria-label="Date range">
<CalendarIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent align="end" alignItemWithTrigger={false}>
{ranges.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</CardAction>
</CardHeader>
<CardContent>
<Badge
variant={current.change.startsWith("-") ? "destructive" : "secondary"}
>
{current.change} vs previous period
</Badge>
</CardContent>
</Card>
)
}
select-17
Loading...
import {
Languages as LanguagesIcon,
} from "@designali/icons"
import {
Field,
FieldContent,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const languages = [
{ label: "English", value: "en", native: "English" },
{ label: "Spanish", value: "es", native: "Espanol" },
{ label: "French", value: "fr", native: "Francais" },
{ label: "German", value: "de", native: "Deutsch" },
{ label: "Japanese", value: "ja", native: "日本語" },
{ label: "Korean", value: "ko", native: "한국어" },
]
export function LanguageSelect() {
return (
<Field orientation="horizontal" className="w-full max-w-sm justify-between">
<FieldContent>
<FieldLabel htmlFor="language">Language</FieldLabel>
<FieldDescription>Applies to menus and emails.</FieldDescription>
</FieldContent>
<Select items={languages} defaultValue="en">
<SelectTrigger id="language" className="w-36">
<LanguagesIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent>
{languages.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
<span className="ms-auto ps-3 text-muted-foreground">
{item.native}
</span>
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
)
}
select-18
Loading...
"use client"
import * as React from "react"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const currencies = [
{ label: "USD", value: "USD", name: "US Dollar", symbol: "$", rate: 1 },
{ label: "EUR", value: "EUR", name: "Euro", symbol: "€", rate: 0.92 },
{
label: "GBP",
value: "GBP",
name: "British Pound",
symbol: "£",
rate: 0.79,
},
{
label: "JPY",
value: "JPY",
name: "Japanese Yen",
symbol: "¥",
rate: 151.4,
},
]
export function CurrencyConverterSelect() {
const [code, setCode] = React.useState<string | null>("USD")
const currency =
currencies.find((item) => item.value === code) ?? currencies[0]!
const amount = 49 * currency.rate
return (
<div className="flex w-full max-w-xs items-center justify-between gap-3 border p-4">
<div className="flex flex-col">
<span className="text-xs text-muted-foreground">
Designali Pro, monthly
</span>
<span className="text-2xl font-semibold tabular-nums">
{currency.symbol}
{currency.value === "JPY" ? Math.round(amount) : amount.toFixed(2)}
</span>
</div>
<Select items={currencies} value={code} onValueChange={setCode}>
<SelectTrigger size="sm" aria-label="Currency">
<SelectValue />
</SelectTrigger>
<SelectContent>
{currencies.map((item) => (
<SelectItem key={item.value} value={item.value}>
<span className="w-4 text-center text-muted-foreground">
{item.symbol}
</span>
{item.label}
<span className="text-muted-foreground">{item.name}</span>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
)
}
select-19
Loading...
"use client"
import * as React from "react"
import {
Type as TypeIcon,
} from "@designali/icons"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { cn } from "@/lib/utils"
const fonts = [
{ label: "Sans serif", value: "sans", className: "font-sans" },
{ label: "Serif", value: "serif", className: "font-sans" },
{ label: "Monospace", value: "mono", className: "font-sans" },
]
export function FontFamilySelect() {
const [font, setFont] = React.useState<string | null>("serif")
const current = fonts.find((item) => item.value === font) ?? fonts[0]!
return (
<div className="flex w-full max-w-sm flex-col gap-3">
<Select items={fonts} value={font} onValueChange={setFont}>
<SelectTrigger className="w-full" aria-label="Font family">
<TypeIcon className="text-muted-foreground" />
<SelectValue className={current.className} />
</SelectTrigger>
<SelectContent>
{fonts.map((item) => (
<SelectItem
key={item.value}
value={item.value}
className={item.className}
>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<p
className={cn(
"border bg-muted/30 p-4 text-sm leading-relaxed",
current.className
)}
>
Where thoughtful design meets production-ready code. Designali designs
and builds digital experiences that work beautifully.
</p>
</div>
)
}
select-20
Loading...
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const roles = [
{ label: "Owner", value: "owner" },
{ label: "Admin", value: "admin" },
{ label: "Editor", value: "editor" },
{ label: "Viewer", value: "viewer" },
]
const members = [
{ name: "Ali Imam", email: "ali@designali.com", role: "owner" },
{ name: "Sam", email: "sam@designali.com", role: "admin" },
{ name: "Iris", email: "iris@designali.com", role: "editor" },
{ name: "Theo", email: "theo@designali.com", role: "viewer" },
]
export function TeamRoleSelect() {
return (
<div className="w-full max-w-md divide-y border">
{members.map((member) => (
<div key={member.email} className="flex items-center gap-3 p-3">
<Avatar>
<AvatarFallback>
{member.name
.split(" ")
.map((part) => part[0])
.join("")}
</AvatarFallback>
</Avatar>
<div className="flex min-w-0 flex-1 flex-col text-sm">
<span className="font-medium">{member.name}</span>
<span className="truncate text-xs text-muted-foreground">
{member.email}
</span>
</div>
<Select
items={roles}
defaultValue={member.role}
disabled={member.role === "owner"}
>
<SelectTrigger
size="sm"
className="w-24"
aria-label={"Role for " + member.name}
>
<SelectValue />
</SelectTrigger>
<SelectContent>
{roles
.filter((role) => role.value !== "owner")
.map((role) => (
<SelectItem key={role.value} value={role.value}>
{role.label}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
))}
</div>
)
}
select-21
Loading...
import {
Field,
FieldContent,
FieldDescription,
FieldGroup,
FieldTitle,
} from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const frequencies = [
{ label: "Instantly", value: "instant" },
{ label: "Hourly digest", value: "hourly" },
{ label: "Daily digest", value: "daily" },
{ label: "Never", value: "never" },
]
const channels = [
{
title: "Mentions",
description: "When someone @mentions you",
value: "instant",
},
{
title: "Comments",
description: "Replies on threads you follow",
value: "hourly",
},
{
title: "Product updates",
description: "New features and changelog",
value: "never",
},
]
export function NotificationSettingsSelects() {
return (
<FieldGroup className="w-full max-w-md">
{channels.map((channel) => (
<Field key={channel.title} orientation="horizontal">
<FieldContent>
<FieldTitle>{channel.title}</FieldTitle>
<FieldDescription>{channel.description}</FieldDescription>
</FieldContent>
<Select items={frequencies} defaultValue={channel.value}>
<SelectTrigger
size="sm"
className="w-32"
aria-label={channel.title + " frequency"}
>
<SelectValue />
</SelectTrigger>
<SelectContent>
{frequencies.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
))}
</FieldGroup>
)
}
select-22
Loading...
"use client"
import * as React from "react"
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const cycles = [
{ label: "Monthly", value: "monthly", price: 20, note: "Billed every month" },
{ label: "Quarterly", value: "quarterly", price: 18, note: "Save 10%" },
{ label: "Yearly", value: "yearly", price: 16, note: "Save 20%" },
]
export function BillingCycleSelect() {
const [cycle, setCycle] = React.useState<string | null>("yearly")
const current = cycles.find((item) => item.value === cycle) ?? cycles[0]!
return (
<Card className="w-full max-w-xs">
<CardHeader>
<CardTitle>Studio plan</CardTitle>
<CardDescription>For small creative studios using Designali.</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-3">
<div className="flex items-baseline gap-1">
<span className="text-3xl font-semibold">{"$" + current.price}</span>
<span className="text-sm text-muted-foreground">
per seat / month
</span>
</div>
<Select items={cycles} value={cycle} onValueChange={setCycle}>
<SelectTrigger className="w-full" aria-label="Billing cycle">
<SelectValue />
</SelectTrigger>
<SelectContent>
{cycles.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
<span className="ms-auto ps-4 text-muted-foreground">
{item.note}
</span>
</SelectItem>
))}
</SelectContent>
</Select>
</CardContent>
<CardFooter>
<Button className="w-full">Upgrade</Button>
</CardFooter>
</Card>
)
}
select-23
Loading...
import {
Server as ServerIcon,
} from "@designali/icons"
import { Badge } from "@/components/ui/badge"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const regions = [
{ label: "US East (Virginia)", value: "us-east", available: true },
{ label: "US West (Oregon)", value: "us-west", available: true },
{ label: "EU Central (Frankfurt)", value: "eu-central", available: true },
{ label: "AP South (Mumbai)", value: "ap-south", available: false },
{ label: "SA East (Sao Paulo)", value: "sa-east", available: false },
]
export function DataRegionSelect() {
return (
<Field className="w-full max-w-xs">
<FieldLabel htmlFor="region">Data region</FieldLabel>
<Select items={regions} defaultValue="eu-central">
<SelectTrigger id="region" className="w-full">
<ServerIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent>
{regions.map((item) => (
<SelectItem
key={item.value}
value={item.value}
disabled={!item.available}
>
{item.label}
{!item.available && (
<Badge variant="outline" className="ms-auto">
Soon
</Badge>
)}
</SelectItem>
))}
</SelectContent>
</Select>
<FieldDescription>
Region cannot be changed after the project is created.
</FieldDescription>
</Field>
)
}
select-24
Loading...
import {
Clock as ClockIcon,
} from "@designali/icons"
import { Field, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const slots = Array.from({ length: 48 }, (_, index) => {
const hours = Math.floor(index / 2)
const minutes = index % 2 === 0 ? "00" : "30"
const period = hours < 12 ? "AM" : "PM"
const display =
(hours % 12 === 0 ? 12 : hours % 12) + ":" + minutes + " " + period
return {
label: display,
value: String(hours).padStart(2, "0") + ":" + minutes,
}
})
export function MeetingTimeSelect() {
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<div className="flex flex-col">
<span className="text-sm font-medium">Designali design review</span>
<span className="text-xs text-muted-foreground">
Thursday, March 12 - 45 min
</span>
</div>
<div className="grid grid-cols-2 gap-2">
<Field>
<FieldLabel htmlFor="start-time">Start</FieldLabel>
<Select items={slots} defaultValue="10:00">
<SelectTrigger id="start-time" className="w-full">
<ClockIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent className="max-h-60">
{slots.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
<Field>
<FieldLabel htmlFor="end-time">End</FieldLabel>
<Select items={slots} defaultValue="10:30">
<SelectTrigger id="end-time" className="w-full">
<ClockIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent className="max-h-60">
{slots.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
</div>
</div>
)
}
select-25
Loading...
"use client"
import * as React from "react"
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const countries = [
{ label: "Canada", value: "ca" },
{ label: "Japan", value: "jp" },
{ label: "Portugal", value: "pt" },
]
const cities: Record<string, { label: string; value: string }[]> = {
ca: [
{ label: "Toronto", value: "toronto" },
{ label: "Vancouver", value: "vancouver" },
{ label: "Montreal", value: "montreal" },
],
jp: [
{ label: "Tokyo", value: "tokyo" },
{ label: "Osaka", value: "osaka" },
{ label: "Kyoto", value: "kyoto" },
],
pt: [
{ label: "Lisbon", value: "lisbon" },
{ label: "Porto", value: "porto" },
],
}
export function CascadingLocationSelect() {
const [country, setCountry] = React.useState<string | null>("jp")
const [city, setCity] = React.useState<string | null>("kyoto")
const cityItems = country ? (cities[country] ?? []) : []
return (
<FieldGroup className="w-full max-w-xs">
<Field>
<FieldLabel htmlFor="country">Country</FieldLabel>
<Select
items={countries}
value={country}
onValueChange={(next) => {
setCountry(next)
setCity(null)
}}
>
<SelectTrigger id="country" className="w-full">
<SelectValue placeholder="Select a country" />
</SelectTrigger>
<SelectContent>
{countries.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
<Field>
<FieldLabel htmlFor="city">City</FieldLabel>
<Select
items={cityItems}
value={city}
onValueChange={setCity}
disabled={!country}
>
<SelectTrigger id="city" className="w-full">
<SelectValue placeholder="Select a city" />
</SelectTrigger>
<SelectContent>
{cityItems.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
</FieldGroup>
)
}
select-26
Loading...
import { Button } from "@/components/ui/button"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const reasons = [
{ label: "Too expensive", value: "price" },
{ label: "Missing features I need", value: "features" },
{ label: "Switching to another tool", value: "switching" },
{ label: "Just taking a break", value: "break" },
{ label: "Other", value: "other" },
]
export function PlaceholderSelect() {
return (
<div className="flex w-full max-w-xs flex-col gap-3">
<div className="flex flex-col gap-1">
<h3 className="text-sm font-medium">Sorry to see you go</h3>
<p className="text-xs text-muted-foreground">
Tell us why you're canceling so we can improve.
</p>
</div>
<Select items={reasons}>
<SelectTrigger className="w-full" aria-label="Cancellation reason">
<SelectValue placeholder="Select a reason" />
</SelectTrigger>
<SelectContent>
{reasons.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<Button variant="destructive">Cancel subscription</Button>
</div>
)
}
select-27
Loading...
"use client"
import * as React from "react"
import { Button } from "@/components/ui/button"
import { Field, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const sizes = [
{ label: "1-10 employees", value: "1-10" },
{ label: "11-50 employees", value: "11-50" },
{ label: "51-200 employees", value: "51-200" },
{ label: "201+ employees", value: "201+" },
]
export function FormDataSelect() {
const [submitted, setSubmitted] = React.useState<string | null>(null)
return (
<form
className="flex w-full max-w-xs flex-col gap-4"
onSubmit={(event) => {
event.preventDefault()
const data = new FormData(event.currentTarget)
setSubmitted(String(data.get("companySize") ?? ""))
}}
>
<Field>
<FieldLabel htmlFor="company-size">Company size</FieldLabel>
<Select items={sizes} name="companySize" defaultValue="11-50">
<SelectTrigger id="company-size" className="w-full">
<SelectValue />
</SelectTrigger>
<SelectContent>
{sizes.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
<Button type="submit">Save</Button>
{submitted !== null && (
<p className="bg-muted p-2 font-sans text-xs">
companySize = {submitted}
</p>
)}
</form>
)
}
select-28
Loading...
import {
Lock as LockIcon,
ShieldCheck as ShieldCheckIcon,
} from "@designali/icons"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const policies = [
{ label: "Require SSO", value: "sso" },
{ label: "Password or SSO", value: "any" },
]
export function ReadOnlySelect() {
return (
<Field className="w-full max-w-xs">
<FieldLabel htmlFor="auth-policy">Sign-in method</FieldLabel>
<Select items={policies} defaultValue="sso" readOnly>
<SelectTrigger id="auth-policy" className="w-full bg-muted/50">
<ShieldCheckIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent>
{policies.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<FieldDescription className="flex items-center gap-1">
<LockIcon className="size-3" />
Managed by your organization admin.
</FieldDescription>
</Field>
)
}
select-29
Loading...
"use client"
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { cn } from "@/lib/utils"
const workspaces = [
{
label: "Designali Studio",
value: "acme",
plan: "Pro",
gradient: "from-primary to-primary",
},
{
label: "Dalim Works",
value: "lumen",
plan: "Free",
gradient: "from-primary to-primary",
},
{
label: "Client projects",
value: "harbor",
plan: "Team",
gradient: "from-primary to-primary",
},
]
export function WorkspaceSwitcherSelect() {
return (
<div className="flex h-56 w-full max-w-60 flex-col justify-end border bg-muted/30 p-2">
<Select items={workspaces} defaultValue="acme">
<SelectTrigger className="h-12 w-full" aria-label="Workspace">
<SelectValue>
{(value: string) => {
const workspace = workspaces.find((item) => item.value === value)
if (!workspace) return null
return (
<>
<span
className={cn(
"size-7 shrink-0 bg-linear-to-br",
workspace.gradient
)}
/>
<span className="flex flex-col text-start">
<span className="font-medium">{workspace.label}</span>
<span className="text-muted-foreground">
{workspace.plan} plan
</span>
</span>
</>
)
}}
</SelectValue>
</SelectTrigger>
<SelectContent side="top" alignItemWithTrigger={false}>
<SelectGroup>
<SelectLabel>Workspaces</SelectLabel>
{workspaces.map((item) => (
<SelectItem key={item.value} value={item.value}>
<span className={cn("size-5 bg-linear-to-br", item.gradient)} />
{item.label}
</SelectItem>
))}
</SelectGroup>
</SelectContent>
</Select>
</div>
)
}
select-30
Loading...
"use client"
import * as React from "react"
import {
ChartColumn as ChartColumnIcon,
} from "@designali/icons"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const metrics = [
{ label: "Revenue", value: "revenue", data: [12, 18, 15, 22, 28, 24, 31] },
{ label: "Orders", value: "orders", data: [30, 26, 34, 29, 38, 41, 36] },
{ label: "Refunds", value: "refunds", data: [6, 4, 7, 3, 5, 2, 4] },
]
const days = ["M", "T", "W", "T", "F", "S", "S"]
export function ChartMetricSelect() {
const [metric, setMetric] = React.useState<string | null>("revenue")
const current = metrics.find((item) => item.value === metric) ?? metrics[0]!
const max = Math.max(...current.data)
return (
<div className="flex w-full max-w-sm flex-col gap-4 border p-4">
<div className="flex items-center justify-between">
<span className="text-sm font-medium">This week</span>
<Select items={metrics} value={metric} onValueChange={setMetric}>
<SelectTrigger size="sm" aria-label="Metric">
<ChartColumnIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent>
{metrics.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
<div className="flex h-28 items-end gap-2">
{current.data.map((point, index) => (
<div key={index} className="flex flex-1 flex-col items-center gap-1">
<div
className="w-full bg-primary/80 transition-all"
style={{ height: (point / max) * 96 }}
/>
<span className="text-[10px] text-muted-foreground">
{days[index]}
</span>
</div>
))}
</div>
</div>
)
}
select-31
Loading...
"use client"
import * as React from "react"
import {
FileArchive as FileArchiveIcon,
FileImage as FileImageIcon,
FileSpreadsheet as FileSpreadsheetIcon,
FileText as FileTextIcon,
Files as FilesIcon,
} from "@designali/icons"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const types = [
{ label: "All files", value: "all", icon: FilesIcon },
{ label: "Documents", value: "doc", icon: FileTextIcon },
{ label: "Images", value: "image", icon: FileImageIcon },
{ label: "Spreadsheets", value: "sheet", icon: FileSpreadsheetIcon },
{ label: "Archives", value: "zip", icon: FileArchiveIcon },
]
const files = [
{ name: "Designali brand guidelines.pdf", type: "doc", size: "4.2 MB" },
{ name: "Hero banner.png", type: "image", size: "1.8 MB" },
{ name: "Project estimate.xlsx", type: "sheet", size: "320 KB" },
{ name: "Designali logos.zip", type: "zip", size: "86 MB" },
{ name: "Meeting notes.docx", type: "doc", size: "44 KB" },
]
export function FileTypeFilterSelect() {
const [type, setType] = React.useState<string | null>("all")
const visible = files.filter((file) => type === "all" || file.type === type)
return (
<div className="flex w-full max-w-sm flex-col gap-2">
<Select items={types} value={type} onValueChange={setType}>
<SelectTrigger className="w-44" aria-label="File type">
<SelectValue />
</SelectTrigger>
<SelectContent>
{types.map((item) => (
<SelectItem key={item.value} value={item.value}>
<item.icon className="text-muted-foreground" />
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<ul className="divide-y border text-sm">
{visible.map((file) => (
<li
key={file.name}
className="flex items-center justify-between gap-2 px-3 py-2"
>
<span className="truncate">{file.name}</span>
<span className="shrink-0 text-xs text-muted-foreground">
{file.size}
</span>
</li>
))}
</ul>
</div>
)
}
select-32
Loading...
import {
ChevronLeft as ChevronLeftIcon,
ChevronRight as ChevronRightIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { ButtonGroup } from "@/components/ui/button-group"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const views = [
{ label: "Day", value: "day" },
{ label: "Week", value: "week" },
{ label: "Month", value: "month" },
{ label: "Agenda", value: "agenda" },
]
export function CalendarViewSelect() {
return (
<div className="flex w-full max-w-md items-center gap-2 border p-2">
<ButtonGroup>
<Button variant="outline" size="icon-sm" aria-label="Previous">
<ChevronLeftIcon />
</Button>
<Button variant="outline" size="sm">
Today
</Button>
<Button variant="outline" size="icon-sm" aria-label="Next">
<ChevronRightIcon />
</Button>
</ButtonGroup>
<span className="flex-1 truncate text-sm font-medium">March 2026</span>
<Select items={views} defaultValue="week">
<SelectTrigger size="sm" className="w-24" aria-label="Calendar view">
<SelectValue />
</SelectTrigger>
<SelectContent>
{views.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
)
}
select-33
Loading...
import {
ArrowUp as ArrowUpIcon,
Sparkles as SparklesIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const models = [
{ label: "Swift", value: "swift", hint: "Fast answers" },
{ label: "Balanced", value: "balanced", hint: "Everyday tasks" },
{ label: "Deep", value: "deep", hint: "Complex reasoning" },
]
export function ChatModelSelect() {
return (
<div className="flex w-full max-w-md flex-col gap-2 border p-2">
<textarea
className="min-h-16 resize-none bg-transparent p-1 text-sm outline-none placeholder:text-muted-foreground"
placeholder="Ask about your Designali project..."
aria-label="Message"
/>
<div className="flex items-center justify-between">
<Select items={models} defaultValue="balanced">
<SelectTrigger
size="sm"
className="border-transparent"
aria-label="Model"
>
<SparklesIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent side="top" alignItemWithTrigger={false} align="start">
{models.map((item) => (
<SelectItem key={item.value} value={item.value}>
<span className="flex flex-col">
<span>{item.label}</span>
<span className="text-muted-foreground">{item.hint}</span>
</span>
</SelectItem>
))}
</SelectContent>
</Select>
<Button size="icon-sm" aria-label="Send">
<ArrowUpIcon />
</Button>
</div>
</div>
)
}
select-34
Loading...
"use client"
import * as React from "react"
import {
Repeat as RepeatIcon,
} from "@designali/icons"
import {
Select,
SelectContent,
SelectItem,
SelectSeparator,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const repeats = [
{ label: "Does not repeat", value: "none" },
{ label: "Every day", value: "daily" },
{ label: "Every weekday", value: "weekdays" },
{ label: "Every week", value: "weekly" },
{ label: "Every month", value: "monthly" },
]
export function EventRepeatSelect() {
const [repeat, setRepeat] = React.useState<string | null>("weekly")
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<div className="flex items-center gap-2 text-sm font-medium">
<span className="size-2.5 bg-primary" />
Designali studio standup
</div>
<Select items={repeats} value={repeat} onValueChange={setRepeat}>
<SelectTrigger className="w-full" aria-label="Repeat">
<RepeatIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent>
{repeats.map((item, index) => (
<React.Fragment key={item.value}>
{index === 1 && <SelectSeparator />}
<SelectItem value={item.value}>{item.label}</SelectItem>
</React.Fragment>
))}
</SelectContent>
</Select>
{repeat !== "none" && (
<p className="text-xs text-muted-foreground">
Repeats until you end the series. You can edit single occurrences
later.
</p>
)}
</div>
)
}
select-35
Loading...
"use client"
import * as React from "react"
import {
FolderGit as FolderGitIcon,
} from "@designali/icons"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { Spinner } from "@/components/ui/spinner"
type Repo = { label: string; value: string }
export function AsyncLoadingSelect() {
const [repos, setRepos] = React.useState<Repo[] | null>(null)
React.useEffect(() => {
const timer = setTimeout(() => {
setRepos([
{ label: "designali-web", value: "designali-web" },
{ label: "designali-blocks", value: "designali-blocks" },
{ label: "designali-icons", value: "designali-icons" },
{ label: "designali-logos", value: "designali-logos" },
])
}, 1500)
return () => clearTimeout(timer)
}, [])
const loading = repos === null
return (
<Field className="w-full max-w-xs">
<FieldLabel htmlFor="repository">Repository</FieldLabel>
<Select items={repos ?? []} disabled={loading}>
<SelectTrigger id="repository" className="w-full">
{loading ? (
<Spinner />
) : (
<FolderGitIcon className="text-muted-foreground" />
)}
<SelectValue
placeholder={
loading ? "Loading repositories..." : "Select a repository"
}
/>
</SelectTrigger>
<SelectContent>
{(repos ?? []).map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<FieldDescription>
Connect a repository to enable preview deployments.
</FieldDescription>
</Field>
)
}
select-36
Loading...
"use client"
import * as React from "react"
import {
ChevronLeft as ChevronLeftIcon,
ChevronRight as ChevronRightIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const pageSizes = [
{ label: "10", value: "10" },
{ label: "25", value: "25" },
{ label: "50", value: "50" },
{ label: "100", value: "100" },
]
const total = 248
export function RowsPerPageSelect() {
const [size, setSize] = React.useState<string | null>("25")
const [page, setPage] = React.useState(1)
const perPage = Number(size ?? 25)
const pages = Math.ceil(total / perPage)
return (
<div className="flex w-full max-w-md flex-wrap items-center justify-between gap-3 border-t pt-3 text-xs">
<div className="flex items-center gap-2">
<span className="text-muted-foreground">Rows per page</span>
<Select
items={pageSizes}
value={size}
onValueChange={(next) => {
setSize(next)
setPage(1)
}}
>
<SelectTrigger size="sm" className="w-16" aria-label="Rows per page">
<SelectValue />
</SelectTrigger>
<SelectContent>
{pageSizes.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
<div className="flex items-center gap-2">
<span className="text-muted-foreground tabular-nums">
Page {page} of {pages}
</span>
<Button
variant="outline"
size="icon-sm"
aria-label="Previous page"
disabled={page === 1}
onClick={() => setPage(page - 1)}
>
<ChevronLeftIcon />
</Button>
<Button
variant="outline"
size="icon-sm"
aria-label="Next page"
disabled={page === pages}
onClick={() => setPage(page + 1)}
>
<ChevronRightIcon />
</Button>
</div>
</div>
)
}
select-37
Loading...
import { ButtonGroup } from "@/components/ui/button-group"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const units = [
{ label: "kg", value: "kg" },
{ label: "lb", value: "lb" },
{ label: "oz", value: "oz" },
]
export function WeightUnitSelect() {
return (
<Field className="w-full max-w-60">
<FieldLabel htmlFor="weight">Package weight</FieldLabel>
<ButtonGroup className="w-full">
<Input
id="weight"
type="number"
defaultValue="2.4"
step="0.1"
className="flex-1"
/>
<Select items={units} defaultValue="kg">
<SelectTrigger className="w-20" aria-label="Unit">
<SelectValue />
</SelectTrigger>
<SelectContent alignItemWithTrigger={false} align="end">
{units.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</ButtonGroup>
<FieldDescription>Include packaging for accurate rates.</FieldDescription>
</Field>
)
}
select-38
Loading...
import { ButtonGroup } from "@/components/ui/button-group"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const codes = [
{ label: "+1", value: "us", country: "United States" },
{ label: "+44", value: "uk", country: "United Kingdom" },
{ label: "+49", value: "de", country: "Germany" },
{ label: "+61", value: "au", country: "Australia" },
{ label: "+81", value: "jp", country: "Japan" },
]
export function PhoneCountryCodeSelect() {
return (
<Field className="w-full max-w-xs">
<FieldLabel htmlFor="phone">Phone number</FieldLabel>
<ButtonGroup className="w-full">
<Select items={codes} defaultValue="uk">
<SelectTrigger className="w-20" aria-label="Country code">
<SelectValue />
</SelectTrigger>
<SelectContent
alignItemWithTrigger={false}
align="start"
className="min-w-52"
>
{codes.map((item) => (
<SelectItem key={item.value} value={item.value}>
<span className="w-8 tabular-nums">{item.label}</span>
<span className="text-muted-foreground">{item.country}</span>
</SelectItem>
))}
</SelectContent>
</Select>
<Input
id="phone"
type="tel"
placeholder="7700 900123"
className="flex-1"
/>
</ButtonGroup>
<FieldDescription>
We'll text a code to verify this number.
</FieldDescription>
</Field>
)
}
select-39
Loading...
"use client"
import * as React from "react"
import {
Download as DownloadIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { Spinner } from "@/components/ui/spinner"
const formats = [
{ label: "CSV", value: "csv", hint: "Spreadsheet friendly" },
{ label: "JSON", value: "json", hint: "For developers" },
{ label: "PDF", value: "pdf", hint: "Print-ready report" },
]
export function ExportFormatSelect() {
const [format, setFormat] = React.useState<string | null>("csv")
const [exporting, setExporting] = React.useState(false)
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">Export transactions</span>
<span className="text-xs text-muted-foreground">
1,204 rows from Jan 1 to Mar 31
</span>
</div>
<Select
items={formats}
value={format}
onValueChange={setFormat}
disabled={exporting}
>
<SelectTrigger className="w-full" aria-label="Format">
<SelectValue />
</SelectTrigger>
<SelectContent>
{formats.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
<span className="text-muted-foreground">{item.hint}</span>
</SelectItem>
))}
</SelectContent>
</Select>
<Button
disabled={exporting}
onClick={() => {
setExporting(true)
setTimeout(() => setExporting(false), 1500)
}}
>
{exporting ? (
<Spinner data-icon="inline-start" />
) : (
<DownloadIcon data-icon="inline-start" />
)}
{exporting
? "Exporting..."
: "Download " + (format ?? "").toUpperCase()}
</Button>
</div>
)
}
select-40
Loading...
"use client"
import {
Globe as GlobeIcon,
Lock as LockIcon,
Users as UsersIcon,
} from "@designali/icons"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const levels = [
{
label: "Private",
value: "private",
icon: LockIcon,
hint: "Only you can open it",
},
{
label: "Team",
value: "team",
icon: UsersIcon,
hint: "Everyone at Designali",
},
{
label: "Public link",
value: "public",
icon: GlobeIcon,
hint: "Anyone with the link",
},
]
export function VisibilitySelect() {
return (
<div className="flex w-full max-w-sm items-center justify-between gap-3 border p-3">
<div className="flex min-w-0 flex-col">
<span className="truncate text-sm font-medium">designali.com launch plan v2</span>
<span className="text-xs text-muted-foreground">
Edited 5 minutes ago
</span>
</div>
<Select items={levels} defaultValue="team">
<SelectTrigger size="sm" aria-label="Visibility">
<SelectValue>
{(value: string) => {
const level = levels.find((item) => item.value === value)
if (!level) return null
return (
<>
<level.icon className="text-muted-foreground" />
{level.label}
</>
)
}}
</SelectValue>
</SelectTrigger>
<SelectContent
align="end"
alignItemWithTrigger={false}
className="min-w-56"
>
{levels.map((item) => (
<SelectItem key={item.value} value={item.value}>
<item.icon />
<span className="flex flex-col">
<span>{item.label}</span>
<span className="text-muted-foreground">{item.hint}</span>
</span>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
)
}
select-41
Loading...
"use client"
import * as React from "react"
import {
X as XIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const projects = [
{ label: "designali.com refresh", value: "website" },
{ label: "Blocks v3", value: "mobile" },
{ label: "Icons & logos", value: "internal" },
]
export function ClearableSelect() {
const [project, setProject] = React.useState<string | null>("mobile")
return (
<Field className="w-full max-w-xs">
<FieldLabel htmlFor="project">Project</FieldLabel>
<div className="flex gap-1">
<Select items={projects} value={project} onValueChange={setProject}>
<SelectTrigger id="project" className="flex-1">
<SelectValue placeholder="No project" />
</SelectTrigger>
<SelectContent>
{projects.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<Button
variant="ghost"
size="icon"
aria-label="Clear project"
disabled={!project}
onClick={() => setProject(null)}
>
<XIcon />
</Button>
</div>
<FieldDescription>
Leave empty to file this task in your inbox.
</FieldDescription>
</Field>
)
}
select-42
Loading...
import {
MapPin as MapPinIcon,
} from "@designali/icons"
import { Field, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { cn } from "@/lib/utils"
const warehouses = [
{ label: "Rotterdam DC", value: "rtm", stock: 1240 },
{ label: "Leeds Hub", value: "lds", stock: 312 },
{ label: "Lyon Depot", value: "lyn", stock: 0 },
{ label: "Gdansk Port", value: "gdn", stock: 87 },
]
export function WarehouseSelect() {
return (
<Field className="w-full max-w-xs">
<FieldLabel htmlFor="warehouse">Fulfil from</FieldLabel>
<Select items={warehouses} defaultValue="rtm">
<SelectTrigger id="warehouse" className="w-full">
<MapPinIcon className="text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent>
{warehouses.map((item) => (
<SelectItem
key={item.value}
value={item.value}
disabled={item.stock === 0}
>
{item.label}
<span
className={cn(
"ms-auto ps-4 tabular-nums",
item.stock < 100
? "text-primary dark:text-primary"
: "text-muted-foreground"
)}
>
{item.stock === 0 ? "Out of stock" : item.stock + " units"}
</span>
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
)
}
select-43
Loading...
"use client"
import * as React from "react"
import {
ShoppingBag as ShoppingBagIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const sizes = [
{ label: "XS", value: "xs", left: 0 },
{ label: "S", value: "s", left: 8 },
{ label: "M", value: "m", left: 2 },
{ label: "L", value: "l", left: 14 },
{ label: "XL", value: "xl", left: 0 },
]
export function ApparelSizeSelect() {
const [size, setSize] = React.useState<string | null>(null)
const current = sizes.find((item) => item.value === size)
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<div className="flex items-baseline justify-between">
<span className="text-sm font-medium">Merino crew sweater</span>
<span className="text-sm">$89</span>
</div>
<Select items={sizes} value={size} onValueChange={setSize}>
<SelectTrigger className="w-full" aria-label="Size">
<SelectValue placeholder="Select size" />
</SelectTrigger>
<SelectContent>
{sizes.map((item) => (
<SelectItem
key={item.value}
value={item.value}
disabled={item.left === 0}
>
{item.label}
{item.left === 0 && (
<span className="text-muted-foreground">Sold out</span>
)}
</SelectItem>
))}
</SelectContent>
</Select>
{current && current.left <= 3 && (
<p className="text-xs text-primary dark:text-primary">
Only {current.left} left in {current.label}
</p>
)}
<Button disabled={!size}>
<ShoppingBagIcon data-icon="inline-start" />
Add to bag
</Button>
</div>
)
}
select-44
Loading...
"use client"
import { Field, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { cn } from "@/lib/utils"
const colors = [
{ label: "Graphite", value: "graphite", swatch: "bg-foreground" },
{ label: "Sand", value: "sand", swatch: "bg-primary/20" },
{ label: "Sage", value: "sage", swatch: "bg-chart-1" },
{ label: "Ocean", value: "ocean", swatch: "bg-chart-2" },
{ label: "Clay", value: "clay", swatch: "bg-primary" },
]
export function ColorSwatchSelect() {
return (
<Field className="w-full max-w-56">
<FieldLabel htmlFor="color">Color</FieldLabel>
<Select items={colors} defaultValue="sage">
<SelectTrigger id="color" className="w-full">
<SelectValue>
{(value: string) => {
const color = colors.find((item) => item.value === value)
return (
<>
<span
className={cn(
"size-3.5 rounded-full ring-1 ring-foreground/10",
color?.swatch
)}
/>
{color?.label}
</>
)
}}
</SelectValue>
</SelectTrigger>
<SelectContent>
{colors.map((item) => (
<SelectItem key={item.value} value={item.value}>
<span
className={cn(
"size-3.5 rounded-full ring-1 ring-foreground/10",
item.swatch
)}
/>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
)
}
select-45
Loading...
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const roles = [
{ label: "Founder", value: "founder" },
{ label: "Engineer", value: "engineer" },
{ label: "Designer", value: "designer" },
{ label: "Product manager", value: "pm" },
]
const industries = [
{ label: "Software", value: "software" },
{ label: "Healthcare", value: "healthcare" },
{ label: "Education", value: "education" },
{ label: "Retail", value: "retail" },
]
const sources = [
{ label: "Search engine", value: "search" },
{ label: "A friend or colleague", value: "referral" },
{ label: "Podcast", value: "podcast" },
{ label: "Social media", value: "social" },
]
const questions = [
{ id: "role", label: "What is your role?", items: roles },
{ id: "industry", label: "Which industry are you in?", items: industries },
{ id: "source", label: "How did you hear about us?", items: sources },
]
export function OnboardingProfileSelects() {
return (
<Card className="w-full max-w-sm">
<CardHeader>
<CardDescription>Step 2 of 3</CardDescription>
<CardTitle>Tell us about yourself</CardTitle>
</CardHeader>
<CardContent>
<FieldGroup>
{questions.map((question) => (
<Field key={question.id}>
<FieldLabel htmlFor={question.id}>{question.label}</FieldLabel>
<Select items={question.items}>
<SelectTrigger id={question.id} className="w-full">
<SelectValue placeholder="Select an option" />
</SelectTrigger>
<SelectContent>
{question.items.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
))}
</FieldGroup>
</CardContent>
<CardFooter className="justify-between">
<Button variant="ghost">Back</Button>
<Button>Continue</Button>
</CardFooter>
</Card>
)
}
select-46
Loading...
"use client"
import * as React from "react"
import { Field, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
type Reviewer = { id: number; name: string; team: string }
const reviewers: Reviewer[] = [
{ id: 1, name: "Ali Imam", team: "Design engineering" },
{ id: 2, name: "Kofi", team: "Web development" },
{ id: 3, name: "Rina", team: "Brand identity" },
]
export function ObjectValueSelect() {
const [reviewer, setReviewer] = React.useState<Reviewer | null>({
id: 2,
name: "Kofi",
team: "Payments",
})
return (
<div className="flex w-full max-w-xs flex-col gap-3">
<Field>
<FieldLabel htmlFor="reviewer">Reviewer</FieldLabel>
<Select
value={reviewer}
onValueChange={setReviewer}
itemToStringLabel={(item: Reviewer) => item.name}
isItemEqualToValue={(item: Reviewer, value: Reviewer) =>
item.id === value.id
}
>
<SelectTrigger id="reviewer" className="w-full">
<SelectValue placeholder="Request a review" />
</SelectTrigger>
<SelectContent>
{reviewers.map((item) => (
<SelectItem key={item.id} value={item}>
{item.name}
<span className="text-muted-foreground">{item.team}</span>
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
<pre className="bg-muted p-2 font-mono text-[11px]">
{JSON.stringify(reviewer, null, 2)}
</pre>
</div>
)
}
select-47
Loading...
"use client"
import * as React from "react"
import {
Tag as TagIcon,
X as XIcon,
} from "@designali/icons"
import { Badge } from "@/components/ui/badge"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const labels = [
{ label: "Bug", value: "bug" },
{ label: "Feature", value: "feature" },
{ label: "Docs", value: "docs" },
{ label: "Performance", value: "perf" },
{ label: "Security", value: "security" },
{ label: "Good first issue", value: "first" },
]
const nameOf = (value: string) =>
labels.find((item) => item.value === value)?.label ?? value
export function MultipleTagsBadgesSelect() {
const [selected, setSelected] = React.useState<string[]>(["bug", "perf"])
return (
<div className="flex w-full max-w-xs flex-col gap-2">
<Select
items={labels}
multiple
value={selected}
onValueChange={setSelected}
>
<SelectTrigger className="w-full" aria-label="Labels">
<TagIcon className="text-muted-foreground" />
<SelectValue>
{(value: string[]) => (value.length ? "Edit labels" : "Add labels")}
</SelectValue>
</SelectTrigger>
<SelectContent>
{labels.map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
<div className="flex min-h-6 flex-wrap gap-1">
{selected.map((value) => (
<Badge key={value} variant="secondary" className="gap-1 pe-1">
{nameOf(value)}
<button
type="button"
aria-label={"Remove " + nameOf(value)}
className="text-muted-foreground hover:text-foreground"
onClick={() =>
setSelected(selected.filter((item) => item !== value))
}
>
<XIcon className="size-3" />
</button>
</Badge>
))}
{selected.length === 0 && (
<span className="text-xs text-muted-foreground">No labels yet</span>
)}
</div>
</div>
)
}
select-48
Loading...
"use client"
import * as React from "react"
import {
GitBranch as GitBranchIcon,
Rocket as RocketIcon,
TriangleAlert as TriangleAlertIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { cn } from "@/lib/utils"
const environments = [
{ label: "Development", value: "dev", tone: "bg-primary" },
{ label: "Staging", value: "staging", tone: "bg-primary" },
{ label: "Production", value: "prod", tone: "bg-destructive" },
]
export function DeployEnvironmentSelect() {
const [env, setEnv] = React.useState<string | null>("staging")
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<div className="flex items-center gap-2 text-sm">
<GitBranchIcon className="size-4 text-muted-foreground" />
<span className="font-sans">release/2.8.0</span>
</div>
<Select items={environments} value={env} onValueChange={setEnv}>
<SelectTrigger className="w-full" aria-label="Environment">
<SelectValue>
{(value: string) => {
const item = environments.find((option) => option.value === value)
return (
<>
<span className={cn("size-2", item?.tone)} />
{item?.label}
</>
)
}}
</SelectValue>
</SelectTrigger>
<SelectContent>
{environments.map((item) => (
<SelectItem key={item.value} value={item.value}>
<span className={cn("size-2", item.tone)} />
{item.label}
</SelectItem>
))}
</SelectContent>
</Select>
{env === "prod" && (
<p className="flex items-start gap-1.5 text-xs text-destructive">
<TriangleAlertIcon className="mt-px size-3.5 shrink-0" />
This deploys designali.com to live customers. Make sure staging checks passed.
</p>
)}
<Button variant={env === "prod" ? "destructive" : "default"}>
<RocketIcon data-icon="inline-start" />
Deploy
</Button>
</div>
)
}
select-49
Loading...
"use client"
import * as React from "react"
import {
Bell as BellIcon,
BellOff as BellOffIcon,
} from "@designali/icons"
import {
Select,
SelectContent,
SelectItem,
SelectSeparator,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const reminders = [
{ label: "At time of due date", value: "0" },
{ label: "15 minutes before", value: "15" },
{ label: "1 hour before", value: "60" },
{ label: "1 day before", value: "1440" },
{ label: "No reminder", value: "none" },
]
export function ReminderSelectWithBadge() {
const [reminder, setReminder] = React.useState<string | null>("60")
return (
<div className="flex w-full max-w-sm items-center gap-3 border p-3">
<div className="flex min-w-0 flex-1 flex-col">
<span className="truncate text-sm font-medium">
Send project proposal to Designali client
</span>
<span className="text-xs text-muted-foreground">
Due Friday, 4:00 PM
</span>
</div>
<Select items={reminders} value={reminder} onValueChange={setReminder}>
<SelectTrigger size="sm" aria-label="Reminder">
{reminder === "none" ? (
<BellOffIcon className="text-muted-foreground" />
) : (
<BellIcon className="text-muted-foreground" />
)}
<SelectValue className="hidden sm:flex" />
</SelectTrigger>
<SelectContent
align="end"
alignItemWithTrigger={false}
className="min-w-48"
>
{reminders.slice(0, 4).map((item) => (
<SelectItem key={item.value} value={item.value}>
{item.label}
</SelectItem>
))}
<SelectSeparator />
<SelectItem value="none" className="text-destructive">
No reminder
</SelectItem>
</SelectContent>
</Select>
</div>
)
}
select-50
Loading...
import {
Activity as ActivityIcon,
} from "@designali/icons"
import { Field, FieldLabel } from "@/components/ui/field"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
const intervals = {
"1m": "Every minute",
"5m": "Every 5 minutes",
"15m": "Every 15 minutes",
"1h": "Every hour",
}
export function RecordItemsSelect() {
return (
<div className="flex w-full max-w-sm flex-col gap-3 border p-4">
<div className="flex items-center gap-2">
<ActivityIcon className="size-4 text-primary" />
<span className="text-sm font-medium">www.designali.com/api/health</span>
</div>
<Field orientation="horizontal" className="justify-between">
<FieldLabel htmlFor="interval">Check interval</FieldLabel>
<Select items={intervals} defaultValue="5m">
<SelectTrigger id="interval" className="w-40">
<SelectValue />
</SelectTrigger>
<SelectContent>
{Object.entries(intervals).map(([value, label]) => (
<SelectItem key={value} value={value}>
{label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
</div>
)
}
Categories
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- Card
- Carousel
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Dialog
- Drawer
- Dropdown Menu
- Field
- Hover Card
- Input
- Input OTP
- Label
- Menubar
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip