Slider() — ui Function Reference
Architecture documentation for the Slider() function in slider.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 8095228f_4244_66b0_d94e_b0e9f8899e61["Slider()"] bed8b1a4_2e54_6e38_526f_10b9c94f7b0a["slider.tsx"] 8095228f_4244_66b0_d94e_b0e9f8899e61 -->|defined in| bed8b1a4_2e54_6e38_526f_10b9c94f7b0a style 8095228f_4244_66b0_d94e_b0e9f8899e61 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/v4/registry/new-york-v4/ui/slider.tsx lines 8–61
function Slider({
className,
defaultValue,
value,
min = 0,
max = 100,
...props
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
const _values = React.useMemo(
() =>
Array.isArray(value)
? value
: Array.isArray(defaultValue)
? defaultValue
: [min, max],
[value, defaultValue, min, max]
)
return (
<SliderPrimitive.Root
data-slot="slider"
defaultValue={defaultValue}
value={value}
min={min}
max={max}
className={cn(
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
className
)}
{...props}
>
<SliderPrimitive.Track
data-slot="slider-track"
className={cn(
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
)}
>
<SliderPrimitive.Range
data-slot="slider-range"
className={cn(
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
)}
/>
</SliderPrimitive.Track>
{Array.from({ length: _values.length }, (_, index) => (
<SliderPrimitive.Thumb
data-slot="slider-thumb"
key={index}
className="border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
/>
))}
</SliderPrimitive.Root>
)
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Slider() do?
Slider() is a function in the ui codebase, defined in apps/v4/registry/new-york-v4/ui/slider.tsx.
Where is Slider() defined?
Slider() is defined in apps/v4/registry/new-york-v4/ui/slider.tsx at line 8.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free