Skip to content

Stepper

A controlled native numeric stepper with bounded values.

#Import

Import ui from github.com/egoist/quickgui/go/ui.

import (
	"github.com/egoist/quickgui/go/native"
	"github.com/egoist/quickgui/go/ui"
)

#Usage

func SwiftUiStepperExample() *native.Node {
	value, setValue := ui.CreateSignal(40.0)
	return ui.SwiftUI.Host(
		ui.SwiftUIHostProps{MatchContents: true},
		func() *native.Node {
			return ui.SwiftUI.Stepper(ui.SwiftUIStepperProps{
				Value:         value,
				Min:           0,
				Max:           100,
				Step:          1,
				Label:         "Value",
				OnValueChange: func(next float64, _ *native.Event) { setValue(next) },
			})
		},
	)
}

#API reference

Expand an entry for its description and complete signature. A dash means no declaration default is documented.

SwiftUI.Stepper

View source
ui.SwiftUI.Stepper(props SwiftUIStepperProps) *native.Node
TestIDany—

Stable identifier for native automation and tests.

any
View source
Modifiersany—

Ordered SwiftUI view modifiers applied to the hosted control.

any
View source
Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
View source
Valueany—

The current controlled value. Update application state from the change callback to accept a new value.

any
View source
Minany—

Lower bound of the accepted value.

any
View source
Maxany—

Upper bound of the accepted value.

any
View source
Stepany—

Increment applied by pointer, keyboard, or step controls.

any
View source
Labelany—

Visible native SwiftUI control label.

any
View source
OnValueChangefunc(float64, *native.Event)—

Reports an accepted value change. Use the callback payload to update controlled state.

func(float64, *native.Event)
View source