StepperControl Edit

StepperControl StepperControl

StepperControl shows a stepper control to change a value wrapped in a StepperCell component.

Usage Usage

Usage example

import { StepperControl } from '@wordpress/components';

function Stepper( { onChangeValue, value } ) {
    return (
        <StepperControl
            icon="screenoptions"
            label="Columns"
            maxValue={ 8 }
            minValue={ 1 }
            onChangeValue={ onChangeValue }
            value={ value }
        />
    );
}

Top ↑

Props Props

maxValue maxValue

Maximum value of the stepper.

  • Type: Number
  • Required: Yes
  • Platform: Mobile

Top ↑

minValue minValue

Minimum value of the stepper.

  • Type: Number
  • Required: Yes
  • Platform: Mobile

Top ↑

step step

Step increment value.

  • Type: Number
  • Required: No
  • Platform: Mobile

Top ↑

value value

Current value of the stepper.

  • Type: Number
  • Required: Yes
  • Platform: Mobile

Top ↑

onChangeValue onChangeValue

Callback called when the value has changed

  • Type: Function
  • Required: Yes
  • Platform: Mobile

The argument of the callback is the updated value as a Number.