Forms
TwTimePicker
TwTimePicker is a Blazor time picker component with 12 hour and 24 hour formats. Bind Value or SelectedTime, and set Placeholder and Variant.
Last updated
Basic Time Picker
Bind
SelectedTime for a TimeOnly value, or Value for a plain string.@bind-SelectedTime (TimeOnly): 8:41 PM
@bind-Value (string): 20:41
Input Variants
The DatePicker supports different visual variants for the input field.
12hr Time Picker
Set
Is12HourFormat to display and enter time in a 12-hour format.@bind-SelectedTime (TimeOnly): 8:41 PM
Dense Time Picker
Set
Dense for a more compact input with a smaller height and text size. Every single-line input shares the same dense height, so they line up when used side by side.Razor
<TwTimePicker Id="dense-timepicker" @bind-SelectedTime="SelectedTime" Label="Dense Time Picker" Dense />Disabled and Readonly Time Picker
Use the
Disabled and ReadOnly properties to restrict interaction with the time picker.Razor
<TwTimePicker Id="disabled-timepicker" @bind-SelectedTime="SelectedTime" Label="Disabled Time Picker" Disabled Class="mt-3" />
<TwTimePicker Id="readonly-timepicker" @bind-SelectedTime="SelectedTime" Label="Readonly Time Picker" ReadOnly Class="mt-3" />Theme Configuration
Styling is controlled by
TwBlazorTheme.Components (a TwTimePickerTheme), configured via the
AddTwBlazor() options callback described on the Get Started page.
Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
| Property | Type | Controls |
|---|---|---|
PickerRoot |
string | |
IconWrapper |
string | |
IconGlyph |
string | |
TextfieldPadding |
string | |
NativeInputAppearance |
string | |
PanelWrapper |
string | |
RangeStageTabsContainer |
string | |
RangeStageTabInactive |
string | |
StageTabBase |
string | |
BodySurface |
string | |
BodyRoot |
string | |
BodyInner |
string | |
ContentRow |
string | |
Column |
string | |
StepButton |
string | |
NumberWrapper |
string | |
NumberInput |
string | |
Separator |
string | |
AmPmWrapper |
string | |
AmPmButtonClass |
string |
Full reference: TwTimePickerTheme on the API docs.