ReScript Shadcn
Get started
  • Installation
Components
  • Accordion
  • Alert
  • AlertDialog
  • AspectRatio
  • Attachment
  • Avatar
  • Badge
  • Breadcrumb
  • Bubble
  • Button
  • ButtonGroup
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • ContextMenu
  • DataTable
  • DatePicker
  • Dialog
  • Direction
  • Drawer
  • DropdownMenu
  • Empty
  • Field
  • HoverCard
  • Input
  • InputGroup
  • InputOtp
  • Item
  • Kbd
  • Label
  • Marker
  • Menubar
  • Message
  • MessageScroller
  • NativeSelect
  • NavigationMenu
  • Pagination
  • Popover
  • Progress
  • RadioGroup
  • Resizable
  • ScrollArea
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Sonner
  • Spinner
  • Switch
  • Table
  • Tabs
  • Textarea
  • Toast
  • Toggle
  • ToggleGroup
  • Tooltip
  • Typography

Slider

An input where the user selects a value from within a given range.

Installation#

npx shadcn@latest add @rescript-shadcn/Slider

Usage#

<Slider defaultValue={[33.]} max={100.} step={1.} />

Examples#

Range#

Use an array with two values for a range slider.

Multiple Thumbs#

Use an array with multiple values for multiple thumbs.

Vertical#

Use orientation="vertical" for a vertical slider.

Controlled#

0.3, 0.7

Disabled#

Use the disabled prop to disable the slider.

API Reference#

See the Base UI Slider documentation.

@@directive("'use client'")

@react.component
@react.component
let make = () =>
  <Slider defaultValue={[75.]} max={100.} step={1.} className="mx-auto w-full max-w-xs" />
@react.component
let make = () =>
  <Slider defaultValue={[25., 50.]} max={100.} step={5.} className="mx-auto w-full max-w-xs" />
@react.component
let make = () =>
  <Slider
open BaseUi.Types

@react.component
@react.component
let make = () =>
  <Slider