Components Layer Layer II

Time Picker

A focused time picker component with scrollable hour and minute columns in 12-hour or 24-hour formats, designed to complement CalendarGrid for full date-time selection.

01

Props

PropTypeDefaultDescription
idstringrequired

The unique identifier for the component container.

mode'hour' | 'minute' | 'second''minute'

Time selection granularity mode ('hour', 'minute', or 'second').

selectedTimestring'12:00'

The selected time string value. Supports $bindable.

format'12h' | '24h''24h'

Time format standard ('12h' or '24h').

stepMinuteIntervalnumber5

Step minute interval increment (e.g., 1, 5, 10, 15, 30).

stepSecondIntervalnumber5

Step second interval increment when mode is 'second'.

showHeaderbooleantrue

Whether to display the header with the active time preview.

variantstring''

User-defined variant name, added to the root element. Style it with a CSS rule that starts from the root.

02

Samples

1. Hour Only Mode

Renders only the hour column for hourly scheduling or timeframe selection.

Hour

14

Selected Hour: 14:00

<script>
  import { TimePicker } from 'fluid-ui-svelte/components';
 
  let selectedHour = $state('14');
</script>
 
<TimePicker
  id="time-picker-hour-only"
  mode="hour"
  bind:selectedTime={selectedHour}
/>

2. Standard Hour & Minute Mode

Select hours and minutes in 24-hour format with customizable minute intervals.

Time

14:30

Selected Time: 14:30

<script>
  import { TimePicker } from 'fluid-ui-svelte/components';
 
  let selectedTime = $state('14:30');
</script>
 
<TimePicker
  id="time-picker-basic"
  mode="minute"
  bind:selectedTime
/>

3. Precise Seconds Mode

Includes an additional column for selecting exact seconds with custom intervals.

Time

14:30:45

Selected Time: 14:30:45

<script>
  import { TimePicker } from 'fluid-ui-svelte/components';
 
  let selectedTime = $state('14:30:45');
</script>
 
<TimePicker
  id="time-picker-seconds"
  mode="second"
  stepSecondInterval={5}
  bind:selectedTime
/>

4. 12-Hour Format with AM / PM

Supports standard 12-hour period selection with dedicated AM and PM selector buttons.

Time

02:30 PM

Selected Time: 02:30 PM

<script>
  import { TimePicker } from 'fluid-ui-svelte/components';
 
  let selectedTime = $state('02:30 PM');
</script>
 
<TimePicker
  id="time-picker-12h"
  format="12h"
  bind:selectedTime
/>