Documentation
¶
Overview ¶
Package radio implements radio fields.
templ: version: v0.2.793
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type D ¶
type D struct {
// ID is the input id (Name if not set).
ID string
// Name is the input name.
Name string
// Label is the input label (either a string, a label.D or a templ.Component).
Label any
// Value is the input value.
Value string
Checked bool
// Disabled disables the input.
Disabled bool
// CustomStyle defines a custom style.
// style.Custom{
// "radio": style.D{style.Add("...")},
// "radio/input": style.D{style.Add("...")},
// "radio/label": style.D{style.Add("...")},
// }
CustomStyle style.Custom
// Attributes stores additional attributes (e.g. HTMX attributes).
Attributes templ.Attributes
}
D is the definition for radio fields.
Example ¶
package main
import (
"context"
"os"
"github.com/jfbus/templui/components/radio"
)
func main() {
c := radio.C(radio.D{
Name: "accept",
Label: "Title",
})
_ = c.Render(context.TODO(), os.Stdout)
}
Output:
Click to show internal directories.
Click to hide internal directories.