Skip to content
Client v5: BLE, BLE Hosting, HTTP, Jobs - Linux, MacOS, & Blazor Support! Full AOT, RX on BLE only & MANY other features! Power up!

DurationPicker

A standalone duration picker control. Tapping it opens a FloatingPanel containing hour and minute pickers (with “hr”/“min” labels) and Done/Cancel buttons. The selected value is exposed as a TimeSpan? via the two-way bindable Duration property.

  • NuGet downloads for Shiny.Maui.Controls
Frameworks
.NET MAUI

DurationPicker uses a FloatingPanel internally, so it must be placed inside a page that provides an overlay host — use ShinyContentPage (recommended) or add an OverlayHost to the visual tree, exactly like a standalone FloatingPanel. Placing it on a plain ContentPage will not display the picker.

<shiny:ShinyContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:shiny="http://shiny.net/maui/controls"
x:Class="MyApp.DurationPage"
Title="Duration">
<shiny:ShinyContentPage.PageContent>
<VerticalStackLayout Padding="20" Spacing="20">
<shiny:DurationPicker Duration="{Binding SelectedDuration, Mode=TwoWay}"
Placeholder="Choose duration" />
</VerticalStackLayout>
</shiny:ShinyContentPage.PageContent>
</shiny:ShinyContentPage>

MinDuration/MaxDuration clamp the selected value, and MinuteInterval controls the minute step shown in the picker (e.g. 1 for every minute, 15 for quarter-hours).

<!-- 15 minutes to 8 hours, 5-minute steps -->
<shiny:DurationPicker Duration="{Binding MeetingLength, Mode=TwoWay}"
MinDuration="0:15:00"
MaxDuration="8:00:00"
MinuteInterval="5"
Placeholder="Select duration" />
<!-- Precise: every minute up to 2 hours -->
<shiny:DurationPicker Duration="{Binding Timer, Mode=TwoWay}"
MinuteInterval="1"
MaxDuration="2:00:00"
Placeholder="Precise duration" />
PropertyTypeDefaultDescription
DurationTimeSpan?nullSelected duration (two-way bindable)
MinDurationTimeSpan0:00:00Minimum allowed duration; the result is clamped to this
MaxDurationTimeSpan24:00:00Maximum allowed duration; also caps the hours shown in the picker
MinuteIntervalint5Minute increment step shown in the minute picker
Formatstringh\:mm.NET TimeSpan format string used for the display text
PlaceholderstringSelect durationText shown when no duration is selected
PlaceholderColorColorGrayPlaceholder text color
TextColorColor?nullSelected-duration text color
FontSizedouble16Display font size
EventSignatureDescription
DurationSelectedEventHandler<TimeSpan>Raised when the user taps Done, with the clamped selected value

Inside a TableView use DurationPickerCell, which wraps the same FloatingPanel-based picker as a settings-style row. It adds PickerTitle, a SelectedCommand (ICommand invoked with the chosen TimeSpan), and ValueTextColor, and shares Duration, MinDuration, MaxDuration, Format, and MinuteInterval.

<shiny:TableViewCell>
<shiny:DurationPickerCell Text="Reminder"
Duration="{Binding Reminder, Mode=TwoWay}"
MinuteInterval="15"
PickerTitle="Remind me after" />
</shiny:TableViewCell>

As with the standalone control, the hosting page must use ShinyContentPage (or an OverlayHost) so the floating panel has somewhere to render.

claude plugin marketplace add shinyorg/skills
claude plugin install controls@shiny
copilot plugin marketplace add https://github.com/shinyorg/skills
copilot plugin install controls@shiny
View controls Plugin