Skip to main content

Number Input

The Number Input widget provides a specialized input field for numerical values with optional validation and formatting.

States

StateTypeDefaultDescription
valuedoubleNoneCurrent numeric value of the input

Properties

PropertyTypeDefaultDescription
labelstring""Label text displayed above the input
placeholderstring""Placeholder text displayed when the input is empty
default_valuedoubleNoneInitial value of the input
requiredboolFalseWhether the input is required
disabledboolFalseWhether the input is disabled
max_valuedoubleNoneMaximum allowed value
min_valuedoubleNoneMinimum allowed value

Examples

Basic Number Input

package main

import (
"github.com/trysourcetool/sourcetool-go"
"github.com/trysourcetool/sourcetool-go/numberinput"
)

func main() {
func page(ui sourcetool.UIBuilder) error {
// Create a basic number input
numberInput := ui.NumberInput("Age")
}
}

Disabled Number Input

// Create a disabled number input
disabledInput := ui.NumberInput("Score (Read Only)", numberinput.Disabled(true))