Initializing the Picker

The range component generates a Mobiscroll input that inherits the theme and overall styling rules. It can however be overridden by setting the relevant options for the component.

There are four ways to use the range picker:

  • Use it on an existing input by using the inputComponent prop. A great example is usage with an IonInput
  • Let the component generate the Mobiscroll input. Give it the extra styling and overrides through options
  • Use it with two separate inputs of any type, one for start and another for end
  • Embed the picker without an input. This can be the page itself or a more complex popup
Get started with this example

Demo

Range picker with one input

Use it on any external input by passing the component to the inputComponent option.

<Datepicker
    select="range"
    inputComponent="input"
    inputProps={{
        placeholder: 'Please Select...'
    }}
/>

If you don't pass a reference to an external input, the component takes care of generating its own input.

<Datepicker
    select="range"
/>
Range picker with two inputs

Sometimes it makes sense to use two separate inputs for start and end. You can pass a reference through the startInput and endInput options of mobiscroll or any type of input, like an ion-input.

const [start, startRef] = React.useState(null);
const [end, endRef] = React.useState(null);
                            
<Datepicker
    select="range"
    startInput={start}
    endInput={end}
/>
<Input
    ref={startRef}
    label="Start"
    placeholder="Please Select...">
</Input>
<Input
    ref={endRef}
    label="End"
    placeholder="Please Select...">
</Input>
Embeddable range picker

It can be embedded into the page or a popup as an inline picker by setting the display option to inline.

<Datepicker
    select="range"
    display="inline"
/>

Duplicate Session

You have signed in on a different machine. To keep everything in sync, you have been signed out of this session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.

Duplicate Session

We noticed you are logged in on a different machine and have closed your old session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.