Badges: filled, glowing, soft, outlined or bare text, with a dot, an icon or a remove button.
<.badge>Default</.badge>
<.badge color="success" shape="pill">Paid</.badge>
<.badge color="primary" variant="soft" dot>Online</.badge>
<.badge color="error" variant="outline" shape="pill">Error</.badge>
<.badge on_remove={JS.hide()}>Filter</.badge>With canvas the badge is the compact canvas lu-badge (tinted by color:
primary, success, error, warning, info, lime; variant solid/outline;
size sm/lg), which is what tables and KPI rows use.
shape defaults to nil, the rounded look of the theme; "rounded" adds the explicit class.
The root style is rendered (empty) unless style={false}.
Summary
Functions
Attributes
color(:string) - Defaults to"neutral". Must be one of"neutral","primary","secondary","info","success","warning","error","dark","light","white", or"lime".variant(:string) - Defaults to"soft". Must be one of"solid","glow","soft","outline", or"flat".size(:string) - Defaults tonil.Must be one ofnil,"xs","sm","md","lg", or"xl".shape(:string) - Defaults tonil.Must be one ofnil,"rounded","pill", or"square".dot(:any) - A dot before the content;"live"pulses. Defaults tofalse.canvas(:boolean) - The compact canvaslu-badge. Defaults tofalse.on_remove(:any) - An event name or aJScommand: adds a remove button after the content. Defaults tonil.id(:string) - Defaults tonil.target(:any) - Thephx-targetofon_removewhen it is an event. Defaults tonil.remove_label(:string) - Defaults to"Remove".style(:any) - Inline style (falseomits the attribute). Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)