BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/basecn/select

Select

basecn/select
FreeComponent

Displays a list of options for the user to pick from—triggered by a button.

Live preview

live · rendered by the registry
Rendered by basecn on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://basecn.dev/r/select.json

Source

src/registry/components/ui/select.tsxbasecn.dev/r/select.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import { Select as SelectPrimitive } from "@base-ui/react/select";
5import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
6
7import { cn } from "@/lib/utils";
8
9const Select = SelectPrimitive.Root;
10
11function SelectGroup({ ...props }: SelectPrimitive.Group.Props) {
12 return <SelectPrimitive.Group data-slot="select-group" {...props} />;
13}
14
15function SelectValue({
16 placeholder,
17 ...props
18}: SelectPrimitive.Value.Props & {
19 placeholder?: string;
20}) {
21 if (!placeholder) {
22 return <SelectPrimitive.Value data-slot="select-value" {...props} />;
23 }
24
25 return (
26 <SelectPrimitive.Value
27 render={(_, { value }) => {
28 if (value) {
29 return <SelectPrimitive.Value data-slot="select-value" {...props} />;
30 }
31
32 // Placeholder
33 return (
34 <span data-slot="select-value" className="text-muted-foreground">
35 {placeholder}
36 </span>
37 );
38 }}
39 {...props}
40 />
41 );
42}
43
44function SelectTrigger({
45 className,
46 size = "default",
47 children,
48 ...props
49}: SelectPrimitive.Trigger.Props & {
50 size?: "sm" | "default";
51}) {
52 return (
53 <SelectPrimitive.Trigger
54 data-slot="select-trigger"
55 data-size={size}
56 className={cn(
57 "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
58 className
59 )}
60 {...props}
61 >
62 {children}
63 <SelectPrimitive.Icon
64 render={<ChevronDownIcon className="size-4 opacity-50" />}
65 />
66 </SelectPrimitive.Trigger>
67 );
68}
69
70function SelectPositioner({
71 className,
72 ...props
73}: SelectPrimitive.Positioner.Props) {
74 return (
75 <SelectPrimitive.Portal>
76 <SelectPrimitive.Positioner
77// … truncated

What it pulls in

npm packages

  • @base-ui/react
  • lucide-react

Files it writes

  • src/registry/components/ui/select.tsx

Facts

Registry
basecn
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on basecn basecn.dev akash3444/basecn on GitHub Raw registry item This item as JSON

More from basecn

All 56 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionbasecnComponentsFree2 deps
AlertalertbasecnComponentsFree1 dep
Alert Dialogalert-dialogbasecnComponentsFree1 dep
Aspect Ratioaspect-ratiobasecnComponentsFreeno deps
AutocompleteautocompletebasecnComponentsFree2 deps
AvataravatarbasecnComponentsFree1 dep
BadgebadgebasecnComponentsFree2 deps
BreadcrumbbreadcrumbbasecnComponentsFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex