UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

8bitcn/8-bit Slider

Inputs & forms
1 of 6
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

6 versions·6 librariesCompare all sliders →

  • 8bitcn
  • Eldora UI
  • Kokonut UI
  • Motion Primitives
  • React Bits
  • shadcn/ui

8-bit Slider

A simple 8-bit slider component

npx shadcn@latest add https://www.8bitcn.com/r/slider.json
Open in v0 Docs Repo
Library
8bitcn
License
MIT
Stack
React · Tailwind CSS · radix
Packages
cnradix-ui
Also adds
slider
Size
58 lines

Code

components/ui/8bit/slider.tsx

"use client";

import * as React from "react";

import * as SliderPrimitive from "@radix-ui/react-slider";

import { cn } from "@/lib/utils";

const Slider = React.forwardRef<
  React.ComponentRef<typeof SliderPrimitive.Root>,
  React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
>(({ className, ...props }, ref) => (
  <div className={cn("relative w-full", className)}>
    <SliderPrimitive.Root
      ref={ref}
      className={cn(
        "relative flex w-full touch-none select-none items-center",
        className
      )}
      {...props}
    >
      <SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden bg-secondary">
        <SliderPrimitive.Range className="absolute h-full bg-primary" />
      </SliderPrimitive.Track>
      <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" />
    </SliderPrimitive.Root>

    <div
      className="absolute inset-0 border-y-4 -my-1 border-foreground dark:border-ring pointer-events-none"
      aria-hidden="true"
    />

    <div
      className="absolute inset-0 border-x-4 -mx-1 border-foreground dark:border-ring pointer-events-none"
      aria-hidden="true"
    />
  </div>
));
Slider.displayName = SliderPrimitive.Root.displayName;

export { Slider };

More like this

8-bit Health Bar

8bitcn·Feedback & loaders

8-bit Mana Bar

8bitcn·Feedback & loaders

8-bit Progress

8bitcn·Feedback & loaders

8-bit Textarea

8bitcn·Text effects

Progress

shadcn/ui·Feedback & loaders

Family Button

Cult UI·Buttons

Drape Background

Kokonut UI·Backgrounds

Ai Message

SmoothUI·Backgrounds

Ai Reasoning

SmoothUI·Media & 3D

Bubble Menu

React Bits·BackgroundsMIT+

Slider

shadcn/ui·Inputs & forms

Card Nav

React Bits·NavigationMIT+

8-bit XP Bar

8bitcn·Feedback & loaders

Grid Pattern

Magic UI·Backgrounds

Skeleton

shadcn/ui·Feedback & loaders