The Label names the slider and the Output reads its value, whatever order they are written in.
import {CellSlider} from "@peakui-pro/react";// Rendered as: the hoisted Label, then every other part in the order it was written.// The slider is always horizontal — `orientation` is not accepted.export default () => ( <CellSlider defaultValue={30}> <CellSlider.Label>Volume</CellSlider.Label> <CellSlider.Track> <CellSlider.Fill /> <CellSlider.Thumb /> </CellSlider.Track> <CellSlider.Output /> </CellSlider>);
@layer components { /* The default fill's tint; the edge borders follow it through the data-fill states. */ .cell-slider[data-orientation="horizontal"] .cell-slider__track[data-fill-start="true"] { --cell-slider-fill: var(--default); border-inline-start-color: var(--default); }}
The cell's own variant axis; the core Slider beneath it has none
children
ReactNode
-
The parts; Label parts are hoisted ahead of the rest
className
string
-
Additional classes
render
DOMRenderFunction<'div', SliderRenderProps>
-
Replaces the rendered <div> with your own element
...rest
ComponentProps<typeof SliderRoot>
-
The core Slider root's props minus orientation, which is locked to 'horizontal': value, defaultValue, onChange, minValue, maxValue, step, isDisabled, aria-label and the rest of React Aria's Slider attributes
import {CellSlider} from "@peakui-pro/react";export function Basic() { return ( <div className="w-64">
Spacing
Spacing
import {CellSlider} from "@peakui-pro/react";export function Variants() { return ( <div className="flex w-64 flex-col gap-3">
Spacing
Spacing is 0.50
"use client";import {CellSlider} from "@peakui-pro/react";import {useState} from "react";
Spacing
Font Size
Forms Radius
import {CellSlider} from "@peakui-pro/react";/* The row's leading label names the slider; the cell fills the value column. */export function SettingsGroup() { return (
Spacing
Font Size
import {CellSlider} from "@peakui-pro/react";export function SecondaryGroup() { return ( <div className="flex w-full max-w-md flex-col divide-y divide-border rounded-lg border border-border">
Volume
import {CellSlider} from "@peakui-pro/react";/* `step={1}` with whole-number values: the output shows no decimals. */export function IntegerStep() { return (
Spacing
Font Size
import {CellSlider} from "@peakui-pro/react";export function Disabled() { return ( <div className="flex w-64 flex-col gap-2">