Slider
tetra-ui/sliderFreeComponent
A control for selecting a value from a continuous or stepped range.
Live preview
live · rendered by the registry
Rendered by tetra-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://tetra-ui.com/r/slider.jsonSource
1import {2 Host as HostPrimitive,3 Slider as SliderPrimitive,4 type SliderProps as SliderPrimitiveProps,5} from "@expo/ui";6import { tint } from "@expo/ui/swift-ui/modifiers";7import { useCSSVariable, withUniwind } from "uniwind";8import { cn } from "@/lib/utils";910// Types11type SliderProps = Omit<SliderPrimitiveProps, "modifiers"> & {12 className?: string;13};1415// Components16const StyledHost = withUniwind(HostPrimitive);1718export function Slider({19 className,20 max = 100,21 min = 0,22 step = 1,23 ...props24}: SliderProps) {25 const primaryColor = useCSSVariable("--color-primary") as string;2627 return (28 <StyledHost className={cn("w-full flex-1", className)}>29 <SliderPrimitive30 {...props}31 max={max}32 min={min}33 modifiers={[tint(primaryColor)]}34 step={step}35 />36 </StyledHost>37 );38}
What it pulls in
npm packages
Files it writes
More from tetra-ui
All 41 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | tetra-ui | Components | Free | 1 dep | |
| Action Inputaction-input | tetra-ui | Components | Free | no deps | |
| Alertalert | tetra-ui | Components | Free | no deps | |
| Avataravatar | tetra-ui | Components | Free | no deps | |
| Badgebadge | tetra-ui | Components | Free | no deps | |
| Bottom Sheetbottom-sheet | tetra-ui | Components | Free | 4 deps · 7 files | |
| Buttonbutton | tetra-ui | Components | Free | no deps | |
| Cardcard | tetra-ui | Components | Free | no deps |
