6.5 daisyUI convenience components
These helpers are re-exported from frontend and also available from
frontend/daisyui. They map directly to common daisyUI component structures and
usually accept already-renderable Node children.
Typography and buttons
TextNode(text string) Node- Renders text in a
span.
- Renders text in a
PrimaryButton(label string, props ComponentProps) NodeSecondaryButton(label string, props ComponentProps) NodeGhostButton(label string, props ComponentProps) Node- Convenience wrappers around
Buttonthat addbtn-primary,btn-secondary, orbtn-ghostclasses.
- Convenience wrappers around
ButtonWithVariants(label, variant, size, style string, props ComponentProps) Node- Adds
btn-<variant>,btn-<size>, andbtn-<style>when non-empty.
- Adds
Navigation, menus, and layout primitives
Navbar(start, center, end Node) Node- Emits
navbar-start,navbar-center, andnavbar-endslots.
- Emits
Menu(items ...Node) Node- Wraps non-
liitems inlielements.
- Wraps non-
Footer(children ...Node) NodeDrawer(id string, side, content Node) Node- Uses
idfor the drawer toggle input and matching overlay label.
- Uses
Dropdown(trigger, menu Node) NodeDropdownWithPlacement(trigger, menu Node, placement string) Node- Adds
dropdown-<placement>when placement is non-empty.
- Adds
Join(children ...Node) NodeJoinWithDirection(direction string, children ...Node) Node- Adds
join-<direction>when direction is non-empty.
- Adds
Hero, avatar, card-style, and mockup helpers
Hero(title, description string, actions ...Node) NodeAvatar(src, alt, class string) Node- Uses daisyUI avatar markup with the provided wrapper class around
img.
- Uses daisyUI avatar markup with the provided wrapper class around
Stat(title, value, desc string) NodeBrowserMockup(content Node) NodePhoneMockup(content Node) NodeMockupWindow(title string, content Node) Nodetitleis currently accepted for API symmetry but is not rendered.
CodeMockup(lines ...string) Node- Renders each line as a mock terminal row with
data-prefix="$".
- Renders each line as a mock terminal row with
Disclosure, steps, timeline, tabs, and carousel
Accordion(title string, content Node, open bool) Node- Uses radio-backed collapse markup with
name="accordion".
- Uses radio-backed collapse markup with
Collapse(title string, content Node, open bool) Node- Uses checkbox-backed collapse markup.
Steps(items ...Node) NodeStep(label string, active bool) Nodeactiveaddsstep-primary.
StepsWithVariants(items []Node, direction, color, className string) Node- Adds
steps-<direction>andclassName; whencoloris non-empty, existingstepchildren receivestep-<color>.
- Adds
Timeline(items ...Node) NodeTimelineItem(startLabel, endLabel string, content Node) NodeTimelineWithDirection(items []Node, direction string, compact bool, snapIcon bool, className string) Node- Adds
timeline-<direction>,timeline-compact,timeline-snap-icon, andclassNamewhen requested.
- Adds
TabsWithVariants(items []TabsItem, style, placement, size, className string) Node- Adds
tabs-<style>,tabs-<placement>,tabs-<size>, andclassName. TabsItem.Activesetstab-activeandaria-selected="true".TabsItem.Disabledsetstab-disabledanddisabled.
- Adds
Carousel(items ...Node) NodeCarouselItem(id string, child Node) Node
Inputs and form adjuncts
Range(name string, value int, min int, max int) NodeRangeWithVariants(name string, value int, min int, max int, color, size string) Node- Adds
range-<color>andrange-<size>when non-empty.
- Adds
Rating(name string, max int, checked int) NodeRatingWithVariants(name string, max int, checked int, size string, half bool, allowClear bool) Node- Adds
rating-<size>andrating-halfwhen requested. allowClearprepends a hidden value0radio option.
- Adds
Toggle(name string, checked bool) NodeToggleVariant(name string, checked bool, variant string) Node- Recognizes
primary,secondary,accent,neutral,info,success,warning, anddanger/error.
- Recognizes
ToggleWithVariants(name string, checked bool, color string, size string) Node- Adds
toggle-<color>andtoggle-<size>when non-empty.
- Adds
ToggleWithIcons(name string, checked bool, className string) NodeThemeController(options ...Node) NodeThemeControllerOption(theme string, checked bool, className string) Node- Emits a radio input named
theme-buttonswiththeme-controllerand the provided theme value.
- Emits a radio input named
Fieldset(legend string, fields ...Node) NodeLabel(text string) NodeValidator(message string) Node
Feedback, overlays, and visual effects
Tooltip(text string, child Node) NodeTooltipWithVariants(text string, child Node, placement, color string, open bool) Node- Adds
tooltip-<placement>,tooltip-<color>, andtooltip-open.
- Adds
ToastWithPlacement(children []Node, horizontal, vertical, className string) Node- Adds
toast-<horizontal>,toast-<vertical>, andclassName.
- Adds
Loading(sizeClass string) Node- Defaults to
loading loading-spinner; appendssizeClasswhen non-empty.
- Defaults to
LoadingWithVariants(kind string, size string) Node- Blank
kinddefaults tospinner; addsloading-<size>when non-empty.
- Blank
RadialProgress(value int, sizeClass string) NodeStatus(colorClass string) NodeStatusWithVariants(color string, size string) Node- Adds
status-<color>andstatus-<size>when non-empty.
- Adds
Swap(onNode, offNode Node, active bool) NodeSwapWithVariants(onNode, offNode Node, active bool, rotate bool, flip bool) Node- Adds
swap-active,swap-rotate, andswap-flipaccording to flags.
- Adds
FAB(icon Node, label string) Node- Uses
labelas the buttonaria-label.
- Uses
SpeedDial(trigger Node, items ...Node) Node
Data display, media, and utility helpers
List(items ...Node) Node- Wraps non-
liitems and addslist-rowto list entries.
- Wraps non-
Table(headers []string, rows ...[]Node) NodeTableWithVariants(headers []string, rows [][]Node, zebra bool, pinRows bool, pinCols bool, size string) Node- Adds
table-zebra,table-pin-rows,table-pin-cols, andtable-<size>according to arguments.
- Adds
Kbd(text string) NodeCode(text string) NodeIndicator(item, target Node) NodeMask(shapeClass string, child Node) NodeChatBubble(content Node, end bool) Nodeendswitches fromchat-starttochat-end.
Countdown(value int) NodeDock(items ...Node) NodeDockItem(child Node, active bool) Nodeactiveaddsdock-active.
Filter(items ...Node) NodeFilterItem(label string, active bool) Node- Uses radio input markup with
aria-labelset tolabel.
- Uses radio input markup with
Calendar(content Node) NodeCalendarGrid(days ...Node) NodeDiff(before, after Node) NodeTextRotate(words []string, animationClass string) NodeHover3DCard(content Node) NodeHoverGallery(items ...Node) Node