Skip to main content

Parameter Slider

Slider for adjusting AI model parameters (temperature, max tokens, top-p) with presets. Features tooltips, value display, and quick preset buttons for common configurations.

Preview

0.7
0.02.0
Presets:

Installation

Terminalbash

Usage

Reacttsx

Examples

With Presets

0.7
0.02.0
Presets:
tsx

Custom Presets

1024
14096
Presets:
tsx

Multiple Parameters

0.7
0.02.0
Presets:
0.9
0.01.0
1024
14096

Current settings:

Temperature: 0.7, Top P: 0.9, Max Tokens: 1024

tsx

Without Presets

0.0
-2.02.0

ParameterPreset Interface

TypeScripttypescript

Props

NameTypeDefaultDescription
label
Required
stringParameter label
labelAr
stringParameter label in Arabic
description
stringParameter description/tooltip
descriptionAr
stringParameter description in Arabic
value
Required
numberCurrent value
onValueChange
Required
(value: number) => voidCallback when value changes
min
number0Minimum value
max
number1Maximum value
step
number0.1Step size
decimals
number1Number of decimal places to display
presets
ParameterPreset[]Preset values
showValue
booleantrueShow value display
isRTL
booleanfalseWhether text direction is RTL
className
stringAdditional CSS classes

Accessibility

Screen Reader

The slider includes proper labels and ARIA attributes. Tooltips provide additional context for parameters and presets. Current value is announced when changed.

Keyboard Navigation

  • Tab: Navigate to slider or preset buttons
  • / : Adjust value (on slider)
  • Enter: Select preset (on button)
  • Home / End: Jump to min/max

Visual Feedback

Current value is displayed in a badge. Active preset is highlighted. Range labels show min/max values for context.

RTL Considerations

The slider works seamlessly in RTL layouts. Labels, tooltips, and presets all support Arabic translations via the *Ar props.

LTR (English)

0.7
0.02.0

RTL (العربية)

0.7
0.02.0

Related Components

Model Selector

Choose AI models

Token Counter

Track token usage

Chat Message

Display chat messages