Documentation
¶
Overview ¶
Package stepper provides a shadcn/ui-style stepper: a number with two arrow buttons that step it, and a label and a live readout, from the Stepper of MyGo.
stepper.Stepper(c, stepper.Props{
Value: &port,
Min: 1024,
Max: 65535,
Step: 1,
Label: "Port",
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Stepper ¶
Stepper draws the label, the readout and the arrows, and returns the column. The readout follows the value as the user clicks or holds an arrow — it repeats, faster after a while — or presses the arrow keys, Home and End while the control has the focus, because the view builds every frame.
Types ¶
type Props ¶
type Props struct {
// Value is the number being set.
Value *float64
// Min and Max bound the value.
Min, Max float64
// Step is how much the arrows and the arrow keys move the value.
Step float64
// Label is the text above the control, next to the readout.
Label string
// Format renders the readout; the default prints the rounded value.
Format func(v float64) string
}
Props describes the stepper to draw.
Click to show internal directories.
Click to hide internal directories.