Blossom UI

Time picker

Time picker component with hour and minute lists, 12 or 24 hours, minute steps and min and max times.

How to use it

Run npx @blossomui/react add time-picker, or copy src/components/UI/TimePicker/TimePicker.tsx into your React project and import it.

import { TimePicker } from './components/ui/TimePicker'

Props

TimePickerLabels

PropTypeDescription
choose (required)stringAccessible name of the panel.
hours (required)string
minutes (required)string
period (required)string
done (required)stringButton that closes the panel.

TimePickerProps

PropTypeDescription
labelsPartial<TimePickerLabels>Texts of the component. Pass only the ones you want to change, for example to translate it.
requiredbooleanMarks the field as required: an asterisk is shown next to the label.
colorstringAccent color of this component: any CSS color. Without it the component uses `--blossom-accent`, which is pink by default.
labelstring
hintstringHelper text shown under the field.
errorstringError message. It is shown in red under the field and marks it as invalid.
valuestringControlled time as "HH:mm" in 24 hours, for example "14:30". Use together with `onChange`.
defaultValuestringInitial time when the field is not controlled.
onChange(time: string) => voidCalled with the time as "HH:mm" in 24 hours, whatever `hour12` is.
hour12booleanShow the hours from 1 to 12 with AM and PM.
minuteStepnumberGap between the minutes in the list.
minstringEarliest time that can be chosen, as "HH:mm".
maxstringLatest time that can be chosen, as "HH:mm".
placeholderstring
namestringAdds a hidden input with this name so the time is sent with native forms.
disabledboolean

Getting started

  • Introduction
  • Installation
  • Changelog

Customization

  • Colors
  • Brand color
  • Texts and translation

Components

  • Accordion
  • Alert dialog
  • Alerts
  • Avatar
  • Badges
  • Banner
  • Breadcrumb
  • Buttons
  • Calendar
  • Cards
  • Carousel
  • Charts
  • Chip input
  • Collapsible
  • Color picker
  • Combobox
  • Command palette
  • Context menu
  • Copy button
  • Date picker
  • Drawer
  • Dropdown
  • Empty state
  • File upload
  • Footer
  • Forms
  • Hover card
  • Jumbotron
  • KBD
  • Menubar
  • Modal
  • Navbar
  • Navigation menu
  • Number input
  • OTP input
  • Pagination
  • Popover
  • Pricing
  • Progress
  • Rating
  • Resizable panels
  • Scroll area
  • Segmented control
  • Separator
  • Sidebar
  • Skeleton
  • Slider
  • Spinners
  • Stats
  • Stepper
  • Survey
  • Table
  • Tabs
  • Time picker
  • Timeline
  • Timer button
  • Toasts
  • Tooltip
  • Transfer list
  • Tree