Documentation ¶
Overview ¶
templ: version: v0.2.793
Index ¶
Examples ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func C ¶
Example ¶
package main import ( "context" "os" "github.com/jfbus/templui/components/checkbox" "github.com/jfbus/templui/components/checkboxgroup" ) func main() { c := checkboxgroup.C(checkboxgroup.D{ Name: "group", Checkboxes: []checkbox.D{ {Label: "Option 1", Value: "1"}, {Label: "Option 2", Value: "2"}, }, }) _ = c.Render(context.TODO(), os.Stdout) }
Output:
Types ¶
type D ¶
type D struct { // Name is the Name of all inputs. Name string // Style is the checkboxgroup style. Style style.Style // Checkboxes is the list of checkboxes in the group. //playground:import:github.com/jfbus/templui/components/checkbox //playground:default:[]checkbox.D{{Name: "foo", Value: "1", Label: "Choice 1"},{Name: "foo", Value: "2", Label:"Choice 2"}} Checkboxes []checkbox.D // Message adds a validation message below the field. // Just add &message.D{} to add automatic validation. //playground:import:github.com/jfbus/templui/components/form/validation/message //playground:default:&message.D{Message: "Validation message"} Message *message.D // CustomStyle defines a custom style. // style.Custom{ // "checkboxgroup": style.D{style.Add("...")}, // "checkboxgroup/checkbox": style.D{style.Add("...")}, // "checkboxgroup/checkbox/input": style.D{style.Add("...")}, // "checkboxgroup/checkbox/label": style.D{style.Add("...")}, // } CustomStyle style.Custom }
Click to show internal directories.
Click to hide internal directories.