BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn/ui/slider

slider

draco-china-github/slider
FreeComponent

shadcn/ui publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/draco-china/shadcn-pro/main/apps/docs/public/r/styles/radix-sera/slider.json

Source

registry/radix-sera/ui/slider.tsxraw.githubusercontent.com/draco-china/shadcn-pro/main/apps/docs/public/r/styles/radix-sera/slider.json
1"use client"
2
3import * as React from "react"
4import { Slider as SliderPrimitive } from "radix-ui"
5
6import { cn } from "@/registry/radix-sera/lib/utils"
7
8function Slider({
9 className,
10 defaultValue,
11 value,
12 min = 0,
13 max = 100,
14 ...props
15}: React.ComponentProps<typeof SliderPrimitive.Root>) {
16 const _values = React.useMemo(
17 () =>
18 Array.isArray(value)
19 ? value
20 : Array.isArray(defaultValue)
21 ? defaultValue
22 : [min, max],
23 [value, defaultValue, min, max]
24 )
25
26 return (
27 <SliderPrimitive.Root
28 data-slot="slider"
29 defaultValue={defaultValue}
30 value={value}
31 min={min}
32 max={max}
33 className={cn(
34 "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",
35 className
36 )}
37 {...props}
38 >
39 <SliderPrimitive.Track
40 data-slot="slider-track"
41 className="relative grow overflow-hidden bg-input/50 data-horizontal:h-0.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-0.5"
42 >
43 <SliderPrimitive.Range
44 data-slot="slider-range"
45 className="absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full"
46 />
47 </SliderPrimitive.Track>
48 {Array.from({ length: _values.length }, (_, index) => (
49 <SliderPrimitive.Thumb
50 data-slot="slider-thumb"
51 key={index}
52 className="block size-3 shrink-0 border-none bg-primary transition-colors select-none hover:ring-2 hover:ring-ring/30 focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
53 />
54 ))}
55 </SliderPrimitive.Root>
56 )
57}
58
59export { Slider }

Files it writes

  • registry/radix-sera/ui/slider.tsx

Facts

Registry
shadcn/ui
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

draco-china.github.io draco-china/shadcn-pro on GitHub Raw registry item This item as JSON

More from shadcn/ui

All 201 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionshadcn/uiComponentsFreeno deps
alertalertshadcn/uiComponentsFreeno deps
alert-dialogalert-dialogshadcn/uiComponentsFreeno deps
aspect-ratioaspect-ratioshadcn/uiComponentsFreeno deps
avataravatarshadcn/uiComponentsFreeno deps
badgebadgeshadcn/uiComponentsFreeno deps
breadcrumbbreadcrumbshadcn/uiComponentsFreeno deps
buttonbuttonshadcn/uiComponentsFreeno 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