Documentation
¶
Overview ¶
Package checkbox implements creation of checkboxes.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New is responsible to create an instance of a Checkbox.
Example ¶
ExampleNew demonstrates how to create a checkbox component.
package main
import (
"github.com/johnfercher/maroto/v2"
"github.com/johnfercher/maroto/v2/pkg/components/checkbox"
"github.com/johnfercher/maroto/v2/pkg/components/col"
"github.com/johnfercher/maroto/v2/pkg/props"
)
func main() {
m := maroto.New()
checkbox := checkbox.New("checkbox label", props.Checkbox{
Checked: true,
})
col := col.New(12).Add(checkbox)
m.AddRow(10, col)
// generate document
}
Output:
func NewAutoRow ¶
NewAutoRow is responsible for creating an instance of Checkbox grouped in a Row with automatic height.
Example ¶
ExampleNewAutoRow demonstrates how to create a checkbox component wrapped into a row with automatic height.
package main
import (
"github.com/johnfercher/maroto/v2"
"github.com/johnfercher/maroto/v2/pkg/components/checkbox"
"github.com/johnfercher/maroto/v2/pkg/props"
)
func main() {
m := maroto.New()
checkboxRow := checkbox.NewAutoRow("checkbox label", props.Checkbox{
Checked: true,
Size: 5,
Top: 2,
Left: 2,
})
m.AddRows(checkboxRow)
// generate document
}
Output:
func NewCol ¶
NewCol is responsible to create an instance of a Checkbox wrapped in a Col.
Example ¶
ExampleNewCol demonstrates how to create a checkbox component wrapped into a column.
package main
import (
"github.com/johnfercher/maroto/v2"
"github.com/johnfercher/maroto/v2/pkg/components/checkbox"
)
func main() {
m := maroto.New()
checkboxCol := checkbox.NewCol(12, "checkbox label")
m.AddRow(10, checkboxCol)
// generate document
}
Output:
func NewRow ¶
NewRow is responsible to create an instance of a Checkbox wrapped in a Row.
Example ¶
ExampleNewRow demonstrates how to create a checkbox component wrapped into a row.
package main
import (
"github.com/johnfercher/maroto/v2"
"github.com/johnfercher/maroto/v2/pkg/components/checkbox"
)
func main() {
m := maroto.New()
checkboxRow := checkbox.NewRow(10, "checkbox label")
m.AddRows(checkboxRow)
// generate document
}
Output:
Types ¶
type Checkbox ¶
type Checkbox struct {
// contains filtered or unexported fields
}
func (*Checkbox) GetStructure ¶
GetStructure returns the Structure of a Checkbox.