Documentation
¶
Overview ¶
Package button provides button components with multiple variants, sizes, and states following shadcn/ui design patterns.
Index ¶
- func Button(children g.Node, opts ...Option) g.Node
- func Destructive(children g.Node, opts ...Option) g.Node
- func Ghost(children g.Node, opts ...Option) g.Node
- func Group(opts []GroupOption, children ...g.Node) g.Node
- func IconButton(children g.Node, opts ...Option) g.Node
- func Link(children g.Node, opts ...Option) g.Node
- func Outline(children g.Node, opts ...Option) g.Node
- func Primary(children g.Node, opts ...Option) g.Node
- func Secondary(children g.Node, opts ...Option) g.Node
- type GroupOption
- type GroupProps
- type Option
- type Props
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Button ¶
Button creates a button component
Example:
btn := button.Button(
g.Text("Click me"),
button.WithVariant(forgeui.VariantPrimary),
button.WithSize(forgeui.SizeLG),
)
func Destructive ¶
Destructive creates a destructive/danger button
func Group ¶
func Group(opts []GroupOption, children ...g.Node) g.Node
Group creates a button group container Useful for grouping related buttons together
Example:
btnGroup := button.Group(
button.WithGap("2"),
button.Primary(g.Text("Save")),
button.Secondary(g.Text("Cancel")),
)
func IconButton ¶
IconButton creates an icon-only button
Types ¶
type GroupOption ¶
type GroupOption func(*GroupProps)
GroupOption is a functional option for configuring button groups
func WithGroupClass ¶
func WithGroupClass(class string) GroupOption
WithGroupClass adds custom classes to the button group
type GroupProps ¶
GroupProps defines button group configuration
Click to show internal directories.
Click to hide internal directories.