Add fonts, autotable, autotable examples
This commit is contained in:
@@ -36,13 +36,13 @@ func ToggleSwitch(checked bool, onChange func(bool), label, description string,
|
||||
vdom.Attr("aria-checked", ariaChecked),
|
||||
vdom.Attr("class", trackCls),
|
||||
vdom.On(vdom.EVENT_CLICK, toggle),
|
||||
vdom.El("span", vdom.Attr("class", knobCls)),
|
||||
vdom.Span(vdom.Attr("class", knobCls)),
|
||||
}
|
||||
if disabled {
|
||||
btnMods = append(btnMods, vdom.Attr("disabled", "disabled"))
|
||||
}
|
||||
|
||||
mods := []vdom.Mod{vdom.Attr("class", cx("flex items-center gap-2", class)), vdom.El("button", btnMods...)}
|
||||
mods := []vdom.Mod{vdom.Attr("class", cx("flex items-center gap-2", class)), vdom.Button(btnMods...)}
|
||||
|
||||
if label != "" || description != "" {
|
||||
text := []vdom.Mod{vdom.Attr("class", "flex flex-col leading-tight")}
|
||||
@@ -51,15 +51,14 @@ func ToggleSwitch(checked bool, onChange func(bool), label, description string,
|
||||
if disabled {
|
||||
labelColor = "text-neutral-400"
|
||||
}
|
||||
text = append(text, vdom.El("span",
|
||||
vdom.Attr("class", cx("text-sm select-none", labelColor)),
|
||||
text = append(text, vdom.Span(vdom.Attr("class", cx("text-sm select-none", labelColor)),
|
||||
vdom.On(vdom.EVENT_CLICK, toggle),
|
||||
vdom.Text(label)))
|
||||
}
|
||||
if description != "" {
|
||||
text = append(text, vdom.El("span", vdom.Attr("class", "text-xs text-neutral-500"), vdom.Text(description)))
|
||||
text = append(text, vdom.Span(vdom.Attr("class", "text-xs text-neutral-500"), vdom.Text(description)))
|
||||
}
|
||||
mods = append(mods, vdom.El("div", text...))
|
||||
mods = append(mods, vdom.Div(text...))
|
||||
}
|
||||
return vdom.El("div", mods...)
|
||||
return vdom.Div(mods...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user