Displays a badge or a component that looks like a badge.
❯buridan add badgeUse the following to build the Badge component.
from components.ui.badge import badgeFor manual installation, copy each of the source codes below in their respective locations.
Use the variant prop to change the badge's style.
Props used: variant on badge.
Render an icon inside the badge. Add data-icon="inline-start" or data-icon="inline-end" to the icon to position it correctly (adjusts padding automatically).
Props used: data_icon on the icon child.
Render a spinner inside the badge — same data-icon positioning convention as icons.
Props used: data_icon on the spinner child.
Pass rx.el.a as the badge's child to turn it into a link. badge accepts *children, so any interactive element works.
Props used: none required — pass rx.el.a(...) as a child.
Override colors by passing extra classes via class_name.
Props used: class_name on badge.
badge("New", variant="secondary")
Any other prop accepted by a native <span> is also passed straight through.