Primitives
Slider
Radix slider with brand range fill; supports single value and ranges (multiple thumbs).
Motionthumb hover scale via CSS transform
Install
Install Kineto and follow the theme setup once in your app.
bash
npm install kinetotsx
import { Slider } from "kineto/slider";Preview
tsx
"use client";
import * as React from "react";
import * as SliderPrimitive from "@radix-ui/react-slider";
import { cn } from "@/lib/cn";
const Slider = React.forwardRef<
React.ElementRef<typeof SliderPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
>(({ className, ...props }, ref) => {
const thumbs = props.value ?? props.defaultValue ?? [0];
return (
<SliderPrimitive.Root
ref={ref}
className={cn(
"relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50",
className
)}
{...props}
>
<SliderPrimitive.Track className="relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted">
<SliderPrimitive.Range className="absolute h-full bg-brand" />
</SliderPrimitive.Track>
{thumbs.map((_, i) => (
<SliderPrimitive.Thumb
key={i}
className="block size-4 rounded-full border-2 border-brand bg-card shadow-soft transition-transform hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
/>
))}
</SliderPrimitive.Root>
);
});
Slider.displayName = "Slider";
export { Slider };src/components/ui/slider.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value / defaultValue | number[] | — | One entry per thumb. |
| min / max / step | number | — | Range configuration. |