Add fonts, autotable, autotable examples

This commit is contained in:
2026-07-13 13:01:26 -04:00
parent ea3d2a6d03
commit cf8342f8d4
71 changed files with 16084 additions and 1443 deletions

View File

@@ -125,7 +125,7 @@ func Button(p ButtonProps, children ...*vdom.VNode) *vdom.VNode {
mods = append(mods, vdom.Text(p.Text))
}
mods = kids(mods, children)
return vdom.El("button", mods...)
return vdom.Button(mods...)
}
func iconSize(small bool) int {
@@ -144,7 +144,7 @@ func ButtonLink(onClick func(), children ...*vdom.VNode) *vdom.VNode {
if onClick != nil {
mods = append(mods, vdom.On(vdom.EVENT_CLICK, onClick))
}
return vdom.El("button", kids(mods, children)...)
return vdom.Button(kids(mods, children)...)
}
// ButtonLinkRed is the red variant of ButtonLink.
@@ -156,7 +156,7 @@ func ButtonLinkRed(onClick func(), children ...*vdom.VNode) *vdom.VNode {
if onClick != nil {
mods = append(mods, vdom.On(vdom.EVENT_CLICK, onClick))
}
return vdom.El("button", kids(mods, children)...)
return vdom.Button(kids(mods, children)...)
}
// SegmentedButtonOption is one option in a SegmentedButtons group.
@@ -193,10 +193,10 @@ func SegmentedButtons(options []SegmentedButtonOption, value string, onChange fu
if opt.Icon != "" {
btnMods = append(btnMods, Icon(opt.Icon, 12, ""))
}
btnMods = append(btnMods, vdom.El("span", vdom.Text(opt.Label)))
mods = append(mods, vdom.El("button", btnMods...))
btnMods = append(btnMods, vdom.Span(vdom.Text(opt.Label)))
mods = append(mods, vdom.Button(btnMods...))
}
return vdom.El("div", mods...)
return vdom.Div(mods...)
}
// BackLink is an inline chevron-left anchor. onDark switches to on-dark colors.
@@ -205,8 +205,7 @@ func BackLink(href, text string, onDark bool) *vdom.VNode {
if onDark {
color = "text-text-on-dark-muted hover:text-text-on-dark"
}
return vdom.El("a",
vdom.Attr("href", href),
return vdom.A(vdom.Attr("href", href),
vdom.Attr("class", cx("inline-flex items-center gap-1 text-sm no-underline", color)),
Icon("chevron-left", 16, ""),
vdom.Text(text),