Skip to content
Control Components

Stepper

A control for simple incremental value changes.

Similar in functionality to a <Slider>, but with nice big buttons to increment and decrement the value.

Integrates the Stepper control from Neil Shankar's "Inputs for Tweakpane " plugin.

Usage outside of a <Pane> component will implicitly wrap the stepper in <Pane position="inline">.

Note that Svelte Tweakpane UI embeds a functionally identical fork of the plugin with build optimizations.


StepperExample.svelte
<script lang="ts">
import { Stepper } from 'svelte-tweakpane-ui'
let angle = 45
</script>
<Stepper bind:value={angle} label="Angle" step={45} />
<div class="demo" style:--a="{angle}deg"></div>
<style>
div.demo {
aspect-ratio: 1;
width: 100%;
background: linear-gradient(var(--a), magenta, orange);
}
</style>

bindablerequired
Description

A number value to control. The value to control.

Typenumber
optional
Description

Prevent interactivity and gray out the control.

Typeboolean
Defaultfalse
optional
Description

Text displayed next to control.

Typestring
Defaultundefined
optional
Description

Custom color scheme.

TypeTheme
Defaultundefined
Inherits default Tweakpane theme equivalent to ThemeUtils.presets.standard, or the theme set with setGlobalDefaultTheme().
optional
Description

Minimum value.

Specifying both a min and a max prop turns the control into a slider.

Typenumber
Defaultundefined
optional
Description

Maximum value.

Specifying both a min and a max prop turns the control into a slider.

Typenumber
Defaultundefined
optional
Description

The minimum step interval.

Typenumber
Defaultundefined
No step constraint.
optional
Description

The unit scale for pointer-based input for all dimensions.

Typenumber
Defaultundefined
Dynamic based on magnitude of value.
optional
Description

The unit scale for key-based input for all dimensions (e.g. the up and down arrow keys).

Typenumber
Default1
Or stepValue if defined.
optional
Description

A function to customize the point value's string representation (e.g. rounding, etc.).

Type((value: number) => string)
Defaultundefined
Normal .toString() formatting.
optional
Description

When true, expand the width of the control at the expense of the numeric input field.

Typeboolean
Defaultfalse

Description

Fires when value changes.

This event is provided for advanced use cases. It's usually preferred to bind to the value prop instead.

The event.details payload includes a copy of the value and an origin field to distinguish between user-interactive changes (internal) and changes resulting from programmatic manipulation of the value (external).

ExtendsValueChangeEvent
TypeStepperChangeEvent