Skip to main content

Time Input

The Time Input widget provides a specialized input field for selecting time values with a time picker interface.

States

StateTypeDefaultDescription
valuestringNoneCurrent selected time value

Properties

PropertyTypeDefaultDescription
labelstring""Label text displayed above the input
placeholderstring""Placeholder text displayed when no time is selected
default_valuestringNoneInitial time value
requiredboolFalseWhether a time selection is required
disabledboolFalseWhether the time input is disabled

Examples

Basic Time Input

package main

import (
"github.com/sourcetool/sourcetool-go"
"github.com/sourcetool/sourcetool-go/timeinput"
)

func main() {
func page(ui sourcetool.UIBuilder) error {
// Create a basic time input
timeInput := ui.TimeInput("Start Time", timeinput.Placeholder("Select time"))
}
}

Disabled Time Input with Default Value

// Create a disabled time input with a default value
closingTime := ui.TimeInput("Closing Time", timeinput.DefaultValue("18:00:00"), timeinput.Disabled(true))