BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn/select

select

shadcn/select
FreeComponent

shadcn publishes no description for this item.

Live preview

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

Install it

npx shadcn@latest add select

Source

ui/select.tsxui.shadcn.com/r/styles/new-york/select.json
1"use client"
2
3import * as React from "react"
4import * as SelectPrimitive from "@radix-ui/react-select"
5import { Check, ChevronDown, ChevronUp } from "lucide-react"
6
7import { cn } from "@/lib/utils"
8
9const Select = SelectPrimitive.Root
10
11const SelectGroup = SelectPrimitive.Group
12
13const SelectValue = SelectPrimitive.Value
14
15const SelectTrigger = React.forwardRef<
16 React.ElementRef<typeof SelectPrimitive.Trigger>,
17 React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
18>(({ className, children, ...props }, ref) => (
19 <SelectPrimitive.Trigger
20 ref={ref}
21 className={cn(
22 "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
23 className
24 )}
25 {...props}
26 >
27 {children}
28 <SelectPrimitive.Icon asChild>
29 <ChevronDown className="h-4 w-4 opacity-50" />
30 </SelectPrimitive.Icon>
31 </SelectPrimitive.Trigger>
32))
33SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
34
35const SelectScrollUpButton = React.forwardRef<
36 React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
37 React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
38>(({ className, ...props }, ref) => (
39 <SelectPrimitive.ScrollUpButton
40 ref={ref}
41 className={cn(
42 "flex cursor-default items-center justify-center py-1",
43 className
44 )}
45 {...props}
46 >
47 <ChevronUp className="h-4 w-4" />
48 </SelectPrimitive.ScrollUpButton>
49))
50SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
51
52const SelectScrollDownButton = React.forwardRef<
53 React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
54 React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
55>(({ className, ...props }, ref) => (
56 <SelectPrimitive.ScrollDownButton
57 ref={ref}
58 className={cn(
59 "flex cursor-default items-center justify-center py-1",
60 className
61 )}
62 {...props}
63 >
64 <ChevronDown className="h-4 w-4" />
65 </SelectPrimitive.ScrollDownButton>
66))
67SelectScrollDownButton.displayName =
68 SelectPrimitive.ScrollDownButton.displayName
69
70const SelectContent = React.forwardRef<
71 React.ElementRef<typeof SelectPrimitive.Content>,
72 React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
73// … truncated

Files it writes

  • ui/select.tsx

Facts

Registry
shadcn
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on shadcn ui.shadcn.com shadcn-ui/ui on GitHub Raw registry item This item as JSON

More from shadcn

All 62 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionshadcnComponentsFreeno deps
alertalertshadcnComponentsFreeno deps
alert-dialogalert-dialogshadcnComponentsFreeno deps
aspect-ratioaspect-ratioshadcnComponentsFreeno deps
attachmentattachmentshadcnComponentsFreeno deps
avataravatarshadcnComponentsFreeno deps
badgebadgeshadcnComponentsFreeno deps
breadcrumbbreadcrumbshadcnComponentsFreeno 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