CircularTimePicker
A BitCircularTimePicker offers a drop-down control that’s optimized for picking a single time from a clock view where contextual information like the day of the week or fullness of the calendar is important. You can modify the calendar to provide additional context or to limit available times.
Usage
Basic
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
<BitCircularTimePicker Label="Basic CircularTimePicker" />
<BitCircularTimePicker Label="Disabled" IsEnabled="false" />
<BitCircularTimePicker Label="Required" Required />
<BitCircularTimePicker Label="PlaceHolder" Placeholder="Select a time" />
<BitCircularTimePicker Label="TimeFormat (AM/PM)" TimeFormat="BitTimeFormat.TwelveHours" />
<BitCircularTimePicker Label="Custom icon" IconName="@BitIconName.Airplane" />Text input
DateFormat provided for the BitCircularTimePicker.
        13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
<BitCircularTimePicker Label="Text input allowed"
                       AllowTextInput="true"
                       ValueFormat="hh:mm"
                       Placeholder="Enter a time (hh:mm)" />Value format
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
<BitCircularTimePicker Label="Formatted time"
                       ValueFormat="hh-mm.ss"
                       Placeholder="Select a time" />Binding
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
<BitCircularTimePicker @bind-Value="@selectedTime" /> <div>Selected time: @selectedTime.ToString()</div>@code { private TimeSpan? selectedTime = new(5, 12, 15); }
Culture
You also can use our CultureInfoHelper class or check its code to see how to create a custom culture.
1
2
3
4
5
6
7
8
9
10
11
12
<BitCircularTimePicker Label="fa-IR culture"
                       TimeFormat="BitTimeFormat.TwelveHours"
                       Culture="CultureInfoHelper.GetFaIrCultureWithFarsiNames()" />Standalone
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
1
2
3
4
5
6
7
8
9
10
11
12
<BitCircularTimePicker Label="Basic CircularTimePicker" Standalone />
<BitCircularTimePicker Label="Disabled" IsEnabled="false" Standalone />
<BitCircularTimePicker Label="PlaceHolder" Placeholder="Select a time" Standalone />
<BitCircularTimePicker Label="TimeFormat (AM/PM)" TimeFormat="BitTimeFormat.TwelveHours" Standalone />ReadOnly
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
1
2
3
4
5
6
7
8
9
10
11
12
<BitCircularTimePicker Label="Basic CircularTimePicker" ReadOnly @bind-Value="@readOnlyTime" /> <BitCircularTimePicker Label="Text input allowed" ReadOnly AllowTextInput @bind-Value="@readOnlyTime" /> <BitCircularTimePicker Label="Standalone CircularTimePicker" Standalone ReadOnly @bind-Value="@readOnlyTime" /> <BitCircularTimePicker Label="Standalone TimeFormat (AM/PM)" Standalone ReadOnly TimeFormat="BitTimeFormat.TwelveHours" @bind-Value="@readOnlyTime" />@code { private TimeSpan? readOnlyTime = new(2, 50, 0); }
Templates
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12

13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
<BitCircularTimePicker @ref="circularTimePicker"> <LabelTemplate> Custom label <BitButton Variant="BitVariant.Text" IconName="@BitIconName.AlarmClock" OnClick="OpenCallout"></BitButton> </LabelTemplate> </BitCircularTimePicker> <BitCircularTimePicker Label="Custom left-handed icon" IconLocation="BitIconLocation.Left" Placeholder="Select a time"> <IconTemplate> <img src="https://img.icons8.com/fluency/2x/clock.png" width="24" height="24" /> </IconTemplate> </BitCircularTimePicker>@code { private BitCircularTimePicker circularTimePicker; private async Task OpenCallout() { await circularTimePicker.OpenCallout(); } }
Responsive
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
<BitCircularTimePicker Label="Response CircularTimePicker"
                       Placeholder="Select a time" 
                       Responsive />Validation
<EditForm Model="formValidationCircularTimePickerModel" OnValidSubmit="HandleValidSubmit" OnInvalidSubmit="HandleInvalidSubmit"> <DataAnnotationsValidator /> <div class="validation-summary"> <ValidationSummary /> </div> <div> <BitCircularTimePicker @bind-Value="formValidationCircularTimePickerModel.Time" AllowTextInput Placeholder="Select a time" Label="Time required" /> <ValidationMessage For="@(() => formValidationCircularTimePickerModel.Time)" /> </div> <br /> <BitButton ButtonType="BitButtonType.Submit"> Submit </BitButton> </EditForm> @if (string.IsNullOrEmpty(successMessage) is false) { <BitMessage Color="BitColor.Success">@successMessage</BitMessage> } <EditForm Model="formValidationCircularTimePickerModel"> <DataAnnotationsValidator /> <div> <BitCircularTimePicker @bind-Value="formValidationCircularTimePickerModel.Time" AllowTextInput="true" Label="Custom Invalid Error Message" InvalidErrorMessage="Invalid Time!!!" /> <ValidationMessage For="@(() => formValidationCircularTimePickerModel.Time)" /> </div> <br /> <div class="validation-summary"> <ValidationSummary /> </div> </EditForm>@code { public class FormValidationCircularTimePickerModel { [Required] public DateTimeOffset? Date { get; set; } } private FormValidationCircularTimePickerModel formValidationCircularTimePickerModel = new(); private async Task HandleValidSubmit() { await Task.Delay(3000); formValidationCircularTimePickerModel = new(); StateHasChanged(); } }
Style & Class
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
<style> .custom-class { overflow: hidden; margin-inline: 1rem; border-radius: 1rem; border: 2px solid tomato; } .custom-class *, .custom-class *::after { border: none; } .custom-root { height: 3rem; margin: 1rem; display: flex; align-items: end; position: relative; border-radius: 0.5rem; } .custom-label { top: 0; left: 0; z-index: 1; padding: 0; font-size: 1rem; color: darkgray; position: absolute; transform-origin: top left; transform: translate(0, 22px) scale(1); transition: color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms; } .custom-label-top { transform: translate(0, 1.5px) scale(0.75); } .custom-input { padding: 0; font-size: 1rem; font-weight: 900; } .custom-input-container { border-radius: 0; position: relative; border-width: 0 0 1px 0; } .custom-input-container::after { content: ''; width: 0; height: 2px; border: none; position: absolute; inset: 100% 0 0 50%; background-color: blueviolet; transition: width 0.3s ease, left 0.3s ease; } .custom-focus .custom-input-container::after { left: 0; width: 100%; } .custom-focus .custom-label { color: blueviolet; transform: translate(0, 1.5px) scale(0.75); } .custom-toolbar { background-color: blueviolet; } .custom-clock-face { background-color: blueviolet; } .custom-clock-number { font-weight: bold; } .custom-clock-pin, .custom-clock-pointer, .custom-clock-pointer-thumb, .custom-clock-selected-number { color: gray; background-color: white; } .custom-clock-pointer-thumb-minute { border-color: white; } </style> <BitCircularTimePicker Style="margin: 1rem; box-shadow: dodgerblue 0 0 1rem;" /> <BitCircularTimePicker Class="custom-class" /> <BitCircularTimePicker Styles="@(new() { Root = "margin-inline: 1rem;", Focused = "--focused-background: #b2b2b25a;", Input = "padding: 0.5rem;", InputContainer = "background: var(--focused-background);", HourButton = "color: gray;", MinuteButton = "color: gray;", HourMinuteSeparator = "color: gray;", Toolbar = "background-color: transparent;", ClockFace="box-shadow: dodgerblue 0 0 1rem;", ClockPointerThumb = "background-color: blue;" })" /> <BitCircularTimePicker @bind-Value="@classesValue" Label="Select a date" Classes="@(new() { Root = "custom-root", Focused = "custom-focus", Input = "custom-input", InputContainer = "custom-input-container", Label = $"custom-label{(classesValue is null ? string.Empty : " custom-label-top")}", Toolbar = "custom-toolbar", ClockPin = "custom-clock-pin", ClockFace = "custom-clock-face", ClockNumber = "custom-clock-number", ClockPointer = "custom-clock-pointer", ClockPointerThumb = "custom-clock-pointer-thumb", ClockSelectedNumber = "custom-clock-selected-number", ClockPointerThumbMinute = "custom-clock-pointer-thumb-minute" })" />@code { private TimeSpan? classesValue; }
RTL
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
<BitCircularTimePicker Dir="BitDir.Rtl" />API
BitCircularTimePicker parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| AllowTextInput | bool | false | Whether the TimePicker allows input a time string directly or not. | 
| AutoClose | bool | false | If AutoClose is set to true and PickerActions are defined, the hour and the minutes can be defined without any action. | 
| CalloutAriaLabel | string | Clock | Aria label for time picker popup for screen reader users. | 
| CalloutHtmlAttributes | Dictionary<string, object> | new Dictionary<String, Object>() | Capture and render additional attributes in addition to the main callout's parameters. | 
| Classes | BitCircularTimePickerClassStyles | null | Custom CSS classes for different parts of the TimePicker. | 
| CloseButtonTitle | string | Close time picker | The title of the close button (tooltip). | 
| Culture | CultureInfo | CultureInfo.CurrentUICulture | CultureInfo for the TimePicker. | 
| EditMode | BitCircularTimePickerEditMode | BitCircularTimePickerEditMode.Normal | Choose the edition mode. By default, you can edit hours and minutes. | 
| HasBorder | bool | true | Determines if the TimePicker has a border. | 
| IconLocation | BitIconLocation | BitIconLocation.Right | TimePicker icon location. | 
| IconName | string | Clock | Optional TimePicker icon. | 
| IconTemplate | RenderFragment? | null | Custom TimePicker icon template. | 
| InvalidErrorMessage | string? | null | The custom validation error message for the invalid value. | 
| IsOpen | bool | false | Whether or not this TimePicker is open. | 
| Label | string? | null | Label for the TimePicker. | 
| LabelTemplate | RenderFragment? | null | Used to customize the label for the TimePicker. | 
| OnClick | EventCallback | Callback for when clicking on TimePicker input. | |
| OnFocus | EventCallback | Callback for when focus moves into the TimePicker input. | |
| OnFocusIn | EventCallback | Callback for when focus moves into the TimePicker input. | |
| OnFocusOut | EventCallback | Callback for when clicking on TimePicker input. | |
| OnSelectTime | EventCallback<TimeSpan?> | Callback for when the on selected time changed. | |
| Placeholder | string? | null | Placeholder text for the DatePicker. | 
| Responsive | bool | false | Enables the responsive mode in small screens. | 
| ShowCloseButton | bool | false | Whether the TimePicker's close button should be shown or not. | 
| Styles | BitCircularTimePickerClassStyles | null | Custom CSS styles for different parts of the TimePicker. | 
| Standalone | bool | false | Whether the TimePicker is rendered standalone or with the input component and callout. | 
| TabIndex | int | 0 | The tabIndex of the TextField. | 
| TimeFormat | BitTimeFormat | BitTimeFormat.TwentyFourHours | The time format of the time-picker, 24H or 12H. | 
| Underlined | bool | false | Whether or not the Text field of the TimePicker is underlined. | 
| ValueFormat | string? | null | The format of the time in the TimePicker like "HH:mm". | 
BitInputBase parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| DisplayName | string? | null | Gets or sets the display name for this field. | 
| InputHtmlAttributes | IReadOnlyDictionary<string, object>? | null | Gets or sets a collection of additional attributes that will be applied to the created element. | 
| Name | string? | null | Gets or sets the name of the element. Allows access by name from the associated form. | 
| NoValidate | bool | false | Disables the validation of the input. | 
| OnChange | EventCallback<TValue?> | Callback for when the input value changes. | |
| ReadOnly | bool | false | Makes the input read-only. | 
| Required | bool | false | Makes the input required. | 
| Value | TValue? | null | Gets or sets the value of the input. This should be used with two-way binding. | 
BitInputBase public members
| Name | Type | Default value | Description | 
|---|---|---|---|
| InputElement | ElementReference | The ElementReference of the input element. | |
| FocusAsync() | () => ValueTask | Gives focus to the input element. | |
| FocusAsync(bool preventScroll) | (bool preventScroll) => ValueTask | Gives focus to the input element. | 
BitComponentBase parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| AriaLabel | string? | null | The aria-label of the control for the benefit of screen readers. | 
| Class | string? | null | Custom CSS class for the root element of the component. | 
| Dir | BitDir? | null | Determines the component direction. | 
| HtmlAttributes | Dictionary<string, object> | new Dictionary<string, object>() | Capture and render additional attributes in addition to the component's parameters. | 
| Id | string? | null | Custom id attribute for the root element. if null the UniqueId will be used instead. | 
| IsEnabled | bool | true | Whether or not the component is enabled. | 
| Style | string? | null | Custom CSS style for the root element of the component. | 
| Visibility | BitVisibility | BitVisibility.Visible | Whether the component is visible, hidden or collapsed. | 
BitComponentBase public members
| Name | Type | Default value | Description | 
|---|---|---|---|
| UniqueId | Guid | Guid.NewGuid() | The readonly unique id of the root element. it will be assigned to a new Guid at component instance construction. | 
| RootElement | ElementReference | The ElementReference of the root element. | 
BitCircularTimePickerClassStyles properties
| Name | Type | Default value | Description | 
|---|---|---|---|
| Root | string? | null | Custom CSS classes/styles for the root element of the BitCircularTimePicker. | 
| Focused | string? | null | Custom CSS classes/styles for the focused state of the BitCircularTimePicker. | 
| Label | string? | null | Custom CSS classes/styles for the Label of the BitCircularTimePicker. | 
| InputWrapper | string? | null | Custom CSS classes/styles for the input wrapper of the BitCircularTimePicker. | 
| InputContainer | string? | null | Custom CSS classes/styles for the input container of the BitCircularTimePicker. | 
| Input | string? | null | Custom CSS classes/styles for the input of the BitCircularTimePicker. | 
| Icon | string? | null | Custom CSS classes/styles for the icon of the BitCircularTimePicker. | 
| Overlay | string? | null | Custom CSS classes/styles for the overlay of the BitCircularTimePicker. | 
| Callout | string? | null | Custom CSS classes/styles for the callout of the BitCircularTimePicker. | 
| CalloutContainer | string? | null | Custom CSS classes/styles for the callout container of the BitCircularTimePicker. | 
| Toolbar | string? | null | Custom CSS classes/styles for the toolbar of the BitCircularTimePicker. | 
| HourMinuteContainer | string? | null | Custom CSS classes/styles for the hour and minute container of the BitCircularTimePicker. | 
| HourButton | string? | null | Custom CSS classes/styles for the hour button of the BitCircularTimePicker. | 
| MinuteButton | string? | null | Custom CSS classes/styles for the minute button of the BitCircularTimePicker. | 
| HourMinuteSeparator | string? | null | Custom CSS classes/styles for the hour minute separator of the BitCircularTimePicker. | 
| HourMinuteText | string? | null | Custom CSS classes/styles for the hour/minute text of the BitCircularTimePicker. | 
| AmPmContainer | string? | null | Custom CSS classes/styles for the AM/PM container of the BitCircularTimePicker. | 
| AmButton | string? | null | Custom CSS classes/styles for the AM button of the BitCircularTimePicker. | 
| PmButton | string? | null | Custom CSS classes/styles for the PM button of the BitCircularTimePicker. | 
| SelectedButtons | string? | null | Custom CSS classes/styles for the selected buttons of the BitCircularTimePicker. | 
| ClockContainer | string? | null | Custom CSS classes/styles for the clock container of the BitCircularTimePicker. | 
| ClockFace | string? | null | Custom CSS classes/styles for the clock face of the BitCircularTimePicker. | 
| ClockPin | string? | null | Custom CSS classes/styles for the clock pin of the BitCircularTimePicker. | 
| ClockNumber | string? | null | Custom CSS classes/styles for the clock number of the BitCircularTimePicker. | 
| ClockSelectedNumber | string? | null | Custom CSS classes/styles for the clock selected number of the BitCircularTimePicker. | 
| ClockPointer | string? | null | Custom CSS classes/styles for the clock pointer of the BitCircularTimePicker. | 
| ClockPointerThumb | string? | null | Custom CSS classes/styles for the clock pointer thumb of the BitCircularTimePicker. | 
| ClockPointerThumbMinute | string? | null | Custom CSS classes/styles for the close button of the BitCircularTimePicker. | 
| CloseButton | string? | null | Custom CSS classes/styles for the close button of the BitCircularTimePicker. | 
| CloseButtonIcon | string? | null | Custom CSS classes/styles for the close button icon of the BitCircularTimePicker. | 
BitVisibility enum
| Name | Value | Description | 
|---|---|---|
| Visible | 0 | Show content of the component. | 
| Hidden | 1 | Hide content of the component,though the space it takes on the page remains. | 
| Collapsed | 2 | Hide content of the component,though the space it takes on the page gone. | 
BitIconLocation enum
| Name | Value | Description | 
|---|---|---|
| Left | 0 | Show the icon at the left side. | 
| Right | 1 | Show the icon at the right side. | 
BitCircularTimePickerEditMode enum
| Name | Value | Description | 
|---|---|---|
| Normal | 0 | Can edit hours and minutes. | 
| OnlyMinutes | 1 | Can edit only minutes. | 
| OnlyHours | 1 | Can edit only hours. | 
BitTimeFormat enum
| Name | Value | Description | 
|---|---|---|
| TwentyFourHours | 0 | Show time pickers in 24 hours format. | 
| TwelveHours | 1 | Show time pickers in 12 hours format. | 
BitVisibility enum
| Name | Value | Description | 
|---|---|---|
| Visible | 0 | The content of the component is visible. | 
| Hidden | 1 | The content of the component is hidden, but the space it takes on the page remains (visibility:hidden). | 
| Collapsed | 2 | The component is hidden (display:none). | 
BitDir enum
| Name | Value | Description | 
|---|---|---|
| Ltr | 0 | Ltr (left to right) is to be used for languages that are written from the left to the right (like English). | 
| Rtl | 1 | Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic). | 
| Auto | 2 | Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element. | 
Feedback
You can give us your feedback through our GitHub repo by filing a new Issue or starting a new Discussion.
Or you can review / edit this page on GitHub.
Or you can review / edit this component on GitHub.
- On this page