8-bit Slider
8bitcn/sliderFreeComponent
A simple 8-bit slider component
Install it
npx shadcn@latest add https://www.8bitcn.com/r/slider.jsonSource
1"use client";23import * as React from "react";45import * as SliderPrimitive from "@radix-ui/react-slider";67import { cn } from "@/lib/utils";89const Slider = React.forwardRef<10 React.ComponentRef<typeof SliderPrimitive.Root>,11 React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>12>(({ className, ...props }, ref) => (13 <div className={cn("relative w-full", className)}>14 <SliderPrimitive.Root15 ref={ref}16 className={cn(17 "relative flex w-full touch-none select-none items-center",18 className19 )}20 {...props}21 >22 <SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden bg-secondary">23 <SliderPrimitive.Range className="absolute h-full bg-primary" />24 </SliderPrimitive.Track>25 <SliderPrimitive.Thumb className="block size-5 border-2 border-foreground dark:border-ring bg-foreground dark:bg-ring ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50" />26 </SliderPrimitive.Root>2728 <div29 className="absolute inset-0 border-y-4 -my-1 border-foreground dark:border-ring pointer-events-none"30 aria-hidden="true"31 />3233 <div34 className="absolute inset-0 border-x-4 -mx-1 border-foreground dark:border-ring pointer-events-none"35 aria-hidden="true"36 />37 </div>38));39Slider.displayName = SliderPrimitive.Root.displayName;4041export { Slider };
What it pulls in
Other registry items
Files it writes
More from 8bitcn
All 121 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 8-bit Accordionaccordion | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Alertalert | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Alert Dialogalert-dialog | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Avataravatar | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Badgebadge | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Breadcrumbbreadcrumb | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Buttonbutton | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Button Groupbutton-group | 8bitcn | Components | Free | no deps · 4 files |
