BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/nexvyn/select

Select

nexvyn/select
FreeComponent

A form select with a two-layer proximity highlight (selected accent tint + muted hover), drawn check animation, and a trigger label morph on selection change.

Live preview

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

Install it

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

Source

components/ui/select.tsxui.nexvyn.dev/r/select.json · first 6 KB
1'use client'
2
3import {
4 Children,
5 cloneElement,
6 createContext,
7 forwardRef,
8 isValidElement,
9 useCallback,
10 useContext,
11 useEffect,
12 useId,
13 useLayoutEffect,
14 useMemo,
15 useRef,
16 useState,
17 type HTMLAttributes,
18 type ReactElement,
19 type ReactNode,
20} from 'react'
21import { createPortal } from 'react-dom'
22import { AnimatePresence, motion, useReducedMotion, type MotionValue } from 'motion/react'
23import { cn } from '@/lib/utils'
24import { useMounted } from '@/hooks/use-mounted'
25import { playHoverSound, playClickSound } from '@/lib/sound'
26import { springs } from '@/lib/motion-tokens'
27import { useProximityHighlight, ProximityHighlight } from '@/lib/hooks/use-proximity-highlight'
28const MAX_HEIGHT = 320
29const SIDE_OFFSET = 8
30const VIEWPORT_MARGIN = 12
31const TYPEAHEAD_RESET_MS = 500
32interface SelectContextValue {
33 value: string
34 setValue: (v: string) => void
35 open: boolean
36 setOpen: (next: boolean) => void
37 disabled: boolean
38 triggerId: string
39 contentId: string
40 labelMap: React.MutableRefObject<Map<string, string>>
41 registerOption: (value: string, label: string) => void
42 openInteractionRef: React.MutableRefObject<'keyboard' | 'pointer'>
43 itemsWidth: number | null
44 setItemsWidth: (w: number | null) => void
45}
46
47const SelectContext = createContext<SelectContextValue | null>(null)
48
49function useSelectCtx(componentName: string) {
50 const ctx = useContext(SelectContext)
51 if (!ctx) throw new Error(`${componentName} must be used within <Select>`)
52 return ctx
53}
54interface SelectContentContextValue {
55 activeIndex: number | null
56 setActiveIndex: (i: number | null) => void
57 highlightX: ReturnType<typeof import('motion/react').useSpring>
58 highlightSize: MotionValue<number>
59 highlightOpacity: ReturnType<typeof import('motion/react').useSpring>
60 axis: 'x' | 'y'
61 focusedIndex: number
62 setFocusedIndex: (i: number) => void
63 setOpen: (next: boolean) => void
64 registerItem: (index: number, el: HTMLElement | null) => void
65}
66
67const SelectContentContext = createContext<SelectContentContextValue | null>(null)
68
69function useSelectContentCtx(componentName: string) {
70 const ctx = useContext(SelectContentContext)
71 if (!ctx) throw new Error(`${componentName} must be used within <SelectContent>`)
72 return ctx
73}
74function normalizeTypeahead(value: string) {
75 return value
76 .normalize('NFKD')
77 .replace(/[\u0300-\u036f]/g, '')
78 .toLowerCase()
79 .replace(/\s+/g, ' ')
80 .trim()
81}
82
83function clamp(value: number, min: number, max: number) {
84// … truncated

What it pulls in

npm packages

  • motion

Files it writes

  • components/ui/select.tsx
  • lib/hooks/use-proximity-highlight.tsx
  • lib/sound.ts

Facts

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

Go to the source

Docs on nexvyn ui.nexvyn.dev Nexvyn/Nexvyn-ui on GitHub Raw registry item This item as JSON

More from nexvyn

All 33 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
BadgebadgenexvynComponentsFree2 deps · 2 files
Bars Themebars-themenexvynComponentsFree1 dep · 3 files
Bounce Sidebarbounce-sidebarnexvynComponentsFree1 dep · 2 files
BreadcrumbsbreadcrumbsnexvynComponentsFree1 dep · 2 files
CheckboxcheckboxnexvynComponentsFree1 dep · 3 files
Clipboard Fieldclipboard-fieldnexvynComponentsFreeno deps · 2 files
Color Pickercolor-pickernexvynComponentsFreeno deps · 16 files
ComboboxcomboboxnexvynComponentsFree1 dep · 2 files
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