BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/solid-ui/select

Select

solid-ui/select
FreeComponent

A select component

Live preview

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

Install it

npx shadcn@latest add https://www.solid-ui.com/r/select.json

Source

src/registry/ui/select.tsxwww.solid-ui.com/r/select.json
1import type { JSX, ValidComponent } from "solid-js"
2import { splitProps } from "solid-js"
3
4import type { PolymorphicProps } from "@kobalte/core/polymorphic"
5import * as SelectPrimitive from "@kobalte/core/select"
6import { cva } from "class-variance-authority"
7
8import { cn } from "~/lib/utils"
9
10const Select = SelectPrimitive.Root
11const SelectValue = SelectPrimitive.Value
12const SelectHiddenSelect = SelectPrimitive.HiddenSelect
13
14type SelectTriggerProps<T extends ValidComponent = "button"> =
15 SelectPrimitive.SelectTriggerProps<T> & {
16 class?: string | undefined
17 children?: JSX.Element
18 }
19
20const SelectTrigger = <T extends ValidComponent = "button">(
21 props: PolymorphicProps<T, SelectTriggerProps<T>>
22) => {
23 const [local, others] = splitProps(props as SelectTriggerProps, ["class", "children"])
24 return (
25 <SelectPrimitive.Trigger
26 class={cn(
27 "flex h-10 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
28 local.class
29 )}
30 {...others}
31 >
32 {local.children}
33 <SelectPrimitive.Icon
34 as="svg"
35 xmlns="http://www.w3.org/2000/svg"
36 viewBox="0 0 24 24"
37 fill="none"
38 stroke="currentColor"
39 stroke-width="2"
40 stroke-linecap="round"
41 stroke-linejoin="round"
42 class="size-4 opacity-50"
43 >
44 <path d="M8 9l4 -4l4 4" />
45 <path d="M16 15l-4 4l-4 -4" />
46 </SelectPrimitive.Icon>
47 </SelectPrimitive.Trigger>
48 )
49}
50
51type SelectContentProps<T extends ValidComponent = "div"> =
52 SelectPrimitive.SelectContentProps<T> & { class?: string | undefined }
53
54const SelectContent = <T extends ValidComponent = "div">(
55 props: PolymorphicProps<T, SelectContentProps<T>>
56) => {
57 const [local, others] = splitProps(props as SelectContentProps, ["class"])
58 return (
59 <SelectPrimitive.Portal>
60 <SelectPrimitive.Content
61 class={cn(
62 "relative z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-80",
63 local.class
64 )}
65 {...others}
66 >
67 <SelectPrimitive.Listbox class="m-0 p-1" />
68 </SelectPrimitive.Content>
69 </SelectPrimitive.Portal>
70 )
71}
72
73// … truncated

What it pulls in

npm packages

  • solid-js
  • @kobalte/core
  • class-variance-authority

Files it writes

  • src/registry/ui/select.tsx

Facts

Registry
solid-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on solid-ui www.solid-ui.com stefan-karger/solid-ui on GitHub Raw registry item This item as JSON

More from solid-ui

All 55 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionsolid-uiComponentsFree2 deps
Alertalertsolid-uiComponentsFree3 deps
Alert Dialogalert-dialogsolid-uiComponentsFree2 deps
Aspect Ratioaspect-ratiosolid-uiComponentsFree1 dep
Avataravatarsolid-uiComponentsFree2 deps
Badgebadgesolid-uiComponentsFree2 deps
Badge Deltabadge-deltasolid-uiComponentsFree2 deps
Bar Listbar-listsolid-uiComponentsFree1 dep
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