PyModel/pythinker-code / .agents/skills/opentui
opentui
VerifiedBuild terminal UIs with OpenTUI. Covers core, components, audio, keymaps, React, Solid, plugins, testing, standalone executables, QR encoding, SSH, and Three.js WebGPU.
docs/components/slider.mdx
View on GitHub---
title: Slider
description: A draggable slider for continuous values
order: 9
---
# Slider
A draggable slider for continuous values. Supports vertical and horizontal orientations.
## Basic usage
### Renderable API
```typescript
import { SliderRenderable, createCliRenderer } from "@opentui/core"
const renderer = await createCliRenderer()
const slider = new SliderRenderable(renderer, {
id: "volume",
orientation: "horizontal",
width: 30,
height: 1,
min: 0,
max: 100,
value: 25,
onChange: (value) => {
console.log("Value:", value)
},
})
renderer.root.add(slider)
```
## Vertical slider
```typescript
const slider = new SliderRenderable(renderer, {
orientation: "vertical",
width: 2,
height: 10,
min: 0,
max: 1,
value: 0.5,
})
```
## Construct API
> Not available yet. Use `SliderRenderable` for now.
## Properties
| Property | Type | Default | Description |
| ----------------- | ---------------------------- | -------------------------------- | ---------------------------------------------- |
| `orientation` | `"vertical" \| "horizontal"` | required | Slider direction |
| `value` | `number` | `min` | Current value |
| `min` | `number` | `0` | Minimum value |
| `max` | `number` | `100` | Maximum value |
| `viewPortSize` | `number` | `Math.max(1, (max - min) * 0.1)` | Viewport size used to calculate the thumb size |
| `backgroundColor` | `ColorInput` | `"#252527"` | Track color |
| `foregroundColor` | `ColorInput` | `"#9a9ea3"` | Thumb color |
| `onChange` | `(value: number) => void` | - | Called when the stored value changes |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |