Mobilens 中文

Control · Inputs

Stepper

Every state

When
Behaviour

    Usage

    import { useState } from 'react';
    import { Stepper } from '@/components/mobilens/Stepper';
    
    export function TicketQuantity() {
      const [quantity, setQuantity] = useState(1);
      return (
        <Stepper value={quantity} onValueChange={setQuantity} min={0} max={6}
          decreaseLabel="Remove one ticket" increaseLabel="Add one ticket" />
      );
    }
    

    API

    PropTypeDefaultDescription
    value number – Controlled numeric amount.
    onValueChange (value: number) => void – Receives the bounded amount after a press.
    min? number 0 Lowest allowed amount and origin for the step intervals.
    max? number 99 Highest allowed amount, including a partial last step.
    step? number 1 Positive interval between adjacent values.
    decreaseLabel string – Accessible name of the minus button, including what it adjusts.
    increaseLabel string – Accessible name of the plus button, including what it adjusts.
    disabled? boolean false Prevent both changes while preserving the current amount.