# Strength Slider

Discrete level slider that snaps to named seats and animates drifting motes across the top level.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).

<ComponentPreview name="strength-slider">
  <StrengthSliderDemo />
</ComponentPreview>

## Installation [#installation]

```bash
npx shadcn@latest add https://motif.sweetretry.com/r/strength-slider.json
```

Installs the `strength-mote` CSS keyframe into your stylesheet.

## Usage [#usage]

```tsx
import { StrengthSlider } from "@/components/ui/motif/strength-slider";

export function Defaults() {
  const [strength, setStrength] = useState("Medium");

  return (
    <div className="space-y-2">
      <div className="font-medium text-muted-foreground text-xs">Strength</div>
      <StrengthSlider
        aria-label="Strength"
        onChange={setStrength}
        value={strength}
      />
    </div>
  );
}
```

- Renders no label; pass `aria-label` alongside your own heading.
- Pass `options` in ascending order (weakest first); the last option displays the `strength-mote` drift animation (omitted under `prefers-reduced-motion`).
- Dragging or clicking any seat or label commits immediately via `onChange` on each crossing.

<StrengthSliderEffortDemo />

## Accessibility [#accessibility]

- Renders `role="slider"` with `aria-label`, index-based `aria-valuenow`, `aria-valuetext` for the level name, and `touch-none` (seat labels and motes are `aria-hidden`).
- `↑` / `→` move stronger, `↓` / `←` move weaker, and `Home` / `End` jump to either end.

## Component source [#component-source]

<ComponentSource
  name="strength-slider"
  src="registry/new-york/strength-slider.tsx"
  title="strength-slider.tsx"
/>
