BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/patchui/select

Select

patchui/select
FreeComponent

patchui publishes no description for this item.

Install it

npx shadcn@latest add https://ui.hotfix.jobs/r/select.json

Source

registry/components/ui/select.tsxui.hotfix.jobs/r/select.json · first 6 KB
1"use client";
2
3import { Select as SelectPrimitive } from "@base-ui/react/select";
4import { CaretDown, Check } from "@phosphor-icons/react/dist/ssr";
5import { createContext, useContext, useState } from "react";
6import type * as React from "react";
7import { createPortal } from "react-dom";
8import { RemoveScroll } from "react-remove-scroll";
9import { cn } from "@/lib/utils";
10import {
11 itemRow,
12 mobilePopupBackdrop,
13 mobilePopupSurface,
14 overlayLayer,
15 popupSurface,
16 popupTriggerOpen,
17 selectionFocus,
18} from "@/lib/recipes";
19import {
20 MOBILE_MEDIA_QUERY,
21 useMediaQuery,
22} from "../hooks/use-media-query";
23import { Spinner } from "@/components/ui/spinner";
24
25export type SelectSize = "sm" | "md" | "lg";
26export type SelectVariant = "default" | "unstyled";
27
28export interface SelectProps
29 extends Omit<
30 React.ComponentProps<typeof SelectPrimitive.Root>,
31 "value" | "defaultValue" | "onValueChange" | "items"
32 > {
33 value?: string;
34 defaultValue?: string;
35 onValueChange?: (value: string) => void;
36 size?: SelectSize;
37 /** Removes trigger chrome when embedded in a composite surface. */
38 variant?: SelectVariant;
39 /** Content rendered at the start (icon, unit symbol). */
40 prefix?: React.ReactNode;
41 /** Content rendered at the end (before the chevron). */
42 suffix?: React.ReactNode;
43 /** Associates the trigger with a label. */
44 id?: string;
45 /** IDs of elements that describe the trigger. */
46 "aria-describedby"?: string;
47 /** Marks the trigger invalid. Pair with FieldError for its message. */
48 invalid?: boolean;
49 /** Placeholder text shown when no value is selected. */
50 placeholder?: string;
51 /** Class name applied to the trigger. */
52 className?: string;
53 /** Marks the trigger and popup list busy and shows SelectLoading. */
54 loading?: boolean;
55 /** Renders the trigger's selected-value display. Base UI's `Select.Value`
56 * defaults to showing the raw `value` string, which surfaces ugly ids
57 * (uuids, slugs) when the option label doesn't match the value. Pass a
58 * mapper so consumers control the display without rebuilding the
59 * trigger. Return `null` to fall through to the placeholder. */
60 renderValue?: (value: string) => React.ReactNode;
61}
62
63const heightBySize: Record<SelectSize, string> = {
64 sm: "h-6 text-small",
65 md: "h-8 text-small",
66 lg: "h-10 text-regular",
67};
68
69const leadingPad: Record<SelectSize, string> = {
70 sm: "ps-3",
71 md: "ps-3",
72 lg: "ps-3.5",
73};
74
75const trailingPad: Record<SelectSize, string> = {
76 sm: "pe-7",
77// … truncated

What it pulls in

npm packages

  • @base-ui/react
  • @phosphor-icons/react
  • react-remove-scroll

Other registry items

  • https://ui.hotfix.jobs/r/recipes.json
  • https://ui.hotfix.jobs/r/spinner.json
  • https://ui.hotfix.jobs/r/tokens.json
  • https://ui.hotfix.jobs/r/use-media-query.json
  • https://ui.hotfix.jobs/r/utils.json

Files it writes

  • registry/components/ui/select.tsx

Facts

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

Go to the source

ui.hotfix.jobs hotfix-jobs/patch-ui on GitHub Raw registry item This item as JSON

More from patchui

All 51 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionpatchuiComponentsFree2 deps
AvataravatarpatchuiComponentsFree3 deps
BadgebadgepatchuiComponentsFree2 deps
BreadcrumbbreadcrumbpatchuiComponentsFree1 dep
ButtonbuttonpatchuiComponentsFree2 deps
CalendarcalendarpatchuiComponentsFree1 dep
CardcardpatchuiComponentsFree1 dep
CheckboxcheckboxpatchuiComponentsFree2 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