# Slider

A diamond-thumb range with an always-readable value.

- Family: Foundation, imported from `mizu-ui` or `mizu-ui/ui`
- Docs: https://mizu.user64bit.world/components/slider
- Source: https://github.com/0xuser64bit/mizu/blob/main/packages/mizu/src/ui/Slider.tsx

## Usage

```tsx
"use client";

import { useState } from "react";
import { Slider } from "mizu-ui";

export function Example() {
  const [value, setValue] = useState(40);
  return (
    <Slider
      label="Density"
      value={value}
      min={0}
      max={100}
      onChange={setValue}
    />
  );
}
```

## Copy it with the shadcn CLI

```sh
npx shadcn@latest init 0xuser64bit/mizu/preset # once, where there is no components.json
npx shadcn@latest add 0xuser64bit/mizu/slider
```

## Props

- `label`: `string`. Visible range label.
- `value / onChange`: `number / function`. Controlled numeric value.
- `min / max / step`: `number`. Range and step size.

## Accessibility

Labelled native range: keyboard arrows, Home/End and touch behavior are supplied by the browser.

## Motion

Thumb responds to pointer state.
