121
GitHub
Data display

FloatingBadge

Shows a high-emphasis notification count over an icon, avatar, or control.

FrameworksAstro · React · Elements

Registry commandlumen add FloatingBadge

InteractionNative markup

01

See it in context

Preview

12AT3
02

Copy a working example

Usage

astro
---
import {
  Avatar,
  Button,
  FloatingBadge,
  Icon
} from '@santi020k/lumen-astro'
---

<div style="display: flex; gap: 2rem; align-items: center;">
  <span style="display: inline-flex; position: relative;">
    <Button variant="outline" size="icon" aria-label="Inbox">
      <Icon name="inbox" decorative />
    </Button>
    <FloatingBadge
      aria-label="12 unread messages"
      style="position: absolute; right: -0.65rem; top: -0.65rem;"
    >
      12
    </FloatingBadge>
  </span>

  <span style="display: inline-flex; position: relative;">
    <Avatar aria-label="Ana Torres">AT</Avatar>
    <FloatingBadge
      aria-label="3 notifications"
      style="position: absolute; right: -0.65rem; top: -0.65rem;"
    >
      3
    </FloatingBadge>
  </span>
</div>
---
import {
  Avatar,
  Button,
  FloatingBadge,
  Icon
} from '@santi020k/lumen-astro'
---

<div style="display: flex; gap: 2rem; align-items: center;">
  <span style="display: inline-flex; position: relative;">
    <Button variant="outline" size="icon" aria-label="Inbox">
      <Icon name="inbox" decorative />
    </Button>
    <FloatingBadge
      aria-label="12 unread messages"
      style="position: absolute; right: -0.65rem; top: -0.65rem;"
    >
      12
    </FloatingBadge>
  </span>

  <span style="display: inline-flex; position: relative;">
    <Avatar aria-label="Ana Torres">AT</Avatar>
    <FloatingBadge
      aria-label="3 notifications"
      style="position: absolute; right: -0.65rem; top: -0.65rem;"
    >
      3
    </FloatingBadge>
  </span>
</div>
03

Choose your target

Add this component

Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.

bash@santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
bashAstro wrapper
lumen add FloatingBadge
lumen add FloatingBadge

API reference

Lumen-specific props and runtime attributes for the Astro primitive. React props follow the same names; Elements use equivalent kebab-case attributes where custom elements expose them.

AttributeValuesDefaultDescription
class, classNamestring""Merges custom classes with the generated ui-* root classes.
...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.