slider.tsx — ui Source File
Architecture documentation for slider.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR fb6cb91b_e460_107f_3e6f_54261a059fe5["slider.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] fb6cb91b_e460_107f_3e6f_54261a059fe5 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 191e4a89_25e4_f7a3_d5fb_d71d101e0990["utils"] fb6cb91b_e460_107f_3e6f_54261a059fe5 --> 191e4a89_25e4_f7a3_d5fb_d71d101e0990 9c463da6_747b_38dc_586b_cbb4873070b1["radix-ui"] fb6cb91b_e460_107f_3e6f_54261a059fe5 --> 9c463da6_747b_38dc_586b_cbb4873070b1 style fb6cb91b_e460_107f_3e6f_54261a059fe5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { cn } from "@/examples/radix/lib/utils"
import { Slider as SliderPrimitive } from "radix-ui"
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-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",
className
)}
{...props}
>
<SliderPrimitive.Track
data-slot="slider-track"
className="bg-muted relative grow overflow-hidden rounded-full data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1"
>
<SliderPrimitive.Range
data-slot="slider-range"
className="bg-primary absolute select-none data-horizontal:h-full data-vertical:w-full"
/>
</SliderPrimitive.Track>
{Array.from({ length: _values.length }, (_, index) => (
<SliderPrimitive.Thumb
data-slot="slider-thumb"
key={index}
className="border-ring ring-ring/50 relative block size-3 shrink-0 rounded-full border bg-white transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50"
/>
))}
</SliderPrimitive.Root>
)
}
export { Slider }
Domain
Subdomains
Functions
Dependencies
- radix-ui
- react
- utils
Source
Frequently Asked Questions
What does slider.tsx do?
slider.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, SearchAPI subdomain.
What functions are defined in slider.tsx?
slider.tsx defines 1 function(s): Slider.
What does slider.tsx depend on?
slider.tsx imports 3 module(s): radix-ui, react, utils.
Where is slider.tsx in the architecture?
slider.tsx is located at apps/v4/examples/radix/ui/slider.tsx (domain: DocumentationAtlas, subdomain: SearchAPI, directory: apps/v4/examples/radix/ui).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free