Skip to main content
Version: v0.23.2

Designs

Every picker looks native on the platform it runs on, from one code path: iOS on iPhone and iPad, Material Design on Android, and a web design in the browser. You don't write anything for this; it's the default.

A design changes shapes and layout: where Cancel and Done sit, how a field and a chosen day look, whether time is picked on wheels, a clock dial or columns. It never changes your colors, fonts or anything you set yourself.

Loading…
<View style={{ gap: 16 }}>
  <HorizontalList
    items={DESIGNS}
    value={design}
    onChange={setDesign}
  />
  <DatePickerField
    design={design}
    label="Date"
    value={date}
    onConfirm={setDate}
  />
  <TimePicker
    design={design}
    value={time}
    onChange={setTime}
  />
</View>

What each design changes​

iosmaterialweb
Fieldslabel above, 48 talloutlined, 56 tall; the label sits inside, then floats onto the borderlabel above, 40 tall, focus ring while open
Sheet corners242812
Cancel / confirmbeside a centered title, Doneafter the content, OKafter the content, Done
Single selectβœ“ beside the chosen optiona radio on every optionβœ“ beside the chosen option
Option rowsrounded and tinted when chosenedge to edge, untintedcompact, rounded and tinted
Calendarchosen day tinted, today's number coloured, SUN MONchosen day filled, today ringed, S M Tchosen day a filled square, today shaded, Sun Mon
Date sheetcalendarthe picked date in large type above the calendarcalendar
Timewheelsa clock dialcolumns of hours and minutes to click
Date & timeone row of wheelscalendar with time fields to type into under itcalendar with the time columns beside it
Durationwheels with unitsnumber boxes to type intocolumns to click
Monthmonth and year wheelsa grid of months under the yeara grid of months under the year
WeekStripchosen day tinted, SUN MONchosen day filled, S M Tchosen day a filled square, Sun Mon
ColourGrid, Spectrum and Sliders tabs, swatches in a row to scrollswatch circles, then Custom for a saturation square and hue slidera saturation square, eyedropper, hue slider and hex code, then swatches
HorizontalLista sliding raised thumb; filled chipsoutlined segments and chips, the chosen one filled with a βœ“a sliding raised thumb; filled chips
Search fieldsa short gray search bara tall pillan outlined input with a focus ring
EmojiPickercategories at the bottom, the current one on a gray fill, UPPERCASE titlescategories at the bottom, the current one in a tinted pillcategories on top, underlined
Pressdims while heldrippledims while held

design="auto" (the default) picks ios on iOS, web on the web, and material everywhere else (Android, Windows, macOS).

One design everywhere​

Set design on the provider to use one look on every platform. To keep the iOS look on Android and the web:

<PickersProvider design="ios">
<App />
</PickersProvider>

Or Material everywhere, for an app built on Material Design:

<PickersProvider design="material">
<App />
</PickersProvider>

One component​

design on a component wins over the provider's. A field passes its design to the sheet it opens.

<SelectPicker design="material" options={options} value={value} onChange={setValue} />
<TimePickerField design="ios" label="Alarm" value={time} onConfirm={setTime} />

Only part of a design​

Some choices a design makes are props of their own, so you can keep the rest of a design and change just that:

To getSet
Wheels for time in any designdisplay="wheel" on TimePicker
A clock dial, typed fields or columnsdisplay="dial", "input" or "list" on TimePicker
One row of date and time wheelsdisplay="wheel" on DateTimePicker
A calendar with time wheelsdisplay="calendar" and timeDisplay="wheel" on DateTimePicker
The time beside or under the calendartimePosition="beside" or "below" on DateTimePicker
Mon instead of MweekdayFormat="short" on DatePicker
Your own button labelsconfirmLabel / cancelLabel on any sheet or field

Customize a design​

A design is a starting point. Everything you set wins over it:

  • Theme tokens. theme and darkTheme on PickersProvider (colors, radius, spacing, fonts) are merged on top of the design's tokens. radius.sheet sets sheet corners in every design. See Theming.
  • Slot styles. Every visual part takes a style through styles. See Styling with slots.
  • Render props. Replace a row, a day, a trigger or a chevron and keep the behavior. See Render props.
  • Explicit props. confirmLabel, weekdayFormat, display and the others above always win over the design's defaults.

DESIGN_TOKENS shows exactly what each design changes on the light or dark theme. In your own components, usePickerTheme().design tells you which design to match:

const theme = usePickerTheme();
const radius = theme.design === 'material' ? theme.radius.full : theme.radius.md;

Upgrading from 0.10​

Before 0.11, every platform got the iOS look: wheels for times, one row of wheels for DateTimePicker, Done in the sheet header. Android and web apps now get the Material and web designs. To keep the old look, set design="ios" on the provider. To keep only part of it, use the props in Only part of a design.

Upgrading from 0.12​

EmojiPicker now follows the design too: on iOS and Android its category bar moves to the bottom, like the platform's own emoji keyboard, and search fields (in EmojiPicker, SelectList and SelectPicker) take each design's shape. To keep the bar on top, set categoryBarPosition="top".

Previewing other platforms​

design sets the look. To also see how pickers behave on another platform in a browser (fields opening a bottom sheet instead of a dropdown, room for the iOS home indicator), set platform on the provider. See Previewing other platforms. The iOS / Android / Web switch on every live example on this site does both.