Picker
The frame a set of wheels sits in: the selection band across the middle, the fade at the top and bottom edges, and — when you give it onconfirm — the cancel/confirm row under them.
Walkthrough
1. Basic
A wheel of dates, in the order this locale writes them. Flick it.
Date of birth
<script lang="ts"> import { DatePicker } from 'omaris'; let date = $state<Date | null>(new Date(2021, 8, 17));</script><div class="w-80 max-w-full"> <DatePicker surface="card" title="Date of birth" bind:value={date} monthFormat="short" /></div> 2. Time
AM/PM on the wheels, always; the value underneath stays "14:30", so it sorts and stores without a second format.
Opens at
stored as 09:30
<script lang="ts"> import { TimePicker } from 'omaris'; let opensAt = $state('09:30');</script><div class="w-64 max-w-full"> <TimePicker surface="card" title="Opens at" bind:value={opensAt} minuteStep={15} /> <p class="pt-3 text-center text-sm text-muted-foreground"> stored as <code class="font-mono">{opensAt}</code> </p></div> 3. Columns
Picker is only the frame — the band, the fade and the actions. Put any wheels you like inside it.
Duration
<script lang="ts"> import { Picker, PickerColumn, numberOptions } from 'omaris'; let hours = $state(1); let minutes = $state(30);</script><div class="w-72 max-w-full"> <Picker surface="card" title="Duration"> <PickerColumn label="Hours" options={numberOptions(0, 12)} bind:value={hours} unit="hr" loop /> <PickerColumn label="Minutes" options={numberOptions(0, 55, { step: 5, pad: true })} bind:value={minutes} unit="min" loop /> </Picker></div> 4. Sheet
Where a picker belongs on a phone: in a sheet, with the confirm row the onconfirm and oncancel handlers draw for you.
<script lang="ts"> import { Button, DateTimePicker, Sheet, latn } from 'omaris'; let open = $state(false); let starts = $state<Date | null>(new Date()); let draft = $state<Date | null>(new Date()); const format = new Intl.DateTimeFormat( undefined, latn({ dateStyle: 'medium', timeStyle: 'short' }) );</script><div class="flex flex-col items-center gap-3"> <Button variant="outlined" onclick={() => { draft = starts; open = true; }} > {starts ? format.format(starts) : 'Pick a time'} </Button> <Sheet bind:open side="bottom" title="Starts"> <DateTimePicker bind:value={draft} minuteStep={15} onconfirm={() => { starts = draft; open = false; }} oncancel={() => (open = false)} /> </Sheet></div> 5. Overridden
Every part is reachable: a full-bleed band in the accent container, a larger face, seven rows deep instead of five.
Weight
<script lang="ts"> import { NumberPicker } from 'omaris'; let weight = $state(72);</script><div class="w-44 max-w-full"> <NumberPicker surface="card" title="Weight" bind:value={weight} min={40} max={140} unit="kg" visible={7} classes={{ band: 'inset-x-0 rounded-none bg-primary-container' }} columnClasses={{ face: 'text-xl font-semibold' }} /></div>