Documentation
¶
Overview ¶
Package loadingbutton provides the Loading Button expansion of shadcn/ui: a button that turns into a spinner while its work runs, and will not be clicked again until it is done.
loadingbutton.LoadingButton(c, loadingbutton.Props{
Label: "Save",
Loading: app.saving,
OnClick: save,
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Props ¶
type Props struct {
// Label is what the button says; it keeps showing while Loading,
// beside the spinner, so the button keeps its width.
Label string
// Loading turns the label into a spinner, and keeps the button from
// being clicked, until the work it started finishes.
Loading bool
// OnClick runs for a click while the button is not loading.
OnClick func()
}
Props describes the button to draw.
Click to show internal directories.
Click to hide internal directories.