Insignia (Badge)
Pequeño valor numérico o descriptor de estado para elementos de la interfaz de usuario.
Cuándo Usarlo
La insignia normalmente aparece cerca de notificaciones o avatares de usuario con un atractivo llamativo, típicamente mostrando el conteo de mensajes no leídos.
Intención (Intent)
La intención visual o esquema de color de la insignia.
<Badge intent="primary">Primary</Badge>
<Badge intent="secondary">Secondary</Badge>
<Badge intent="success">Success</Badge>
<Badge intent="danger">Danger</Badge>
<Badge intent="warning">Warning</Badge>
<Badge intent="info">Info</Badge> Variantes
La variante de estilo de la insignia. Utilice `solid`, `soft` o `outline`.
<Badge variant="solid" intent="primary">Solid</Badge>
<Badge variant="soft" intent="primary">Soft</Badge>
<Badge variant="outline" intent="primary">Outline</Badge> Tamaños
Establece el tamaño de la insignia.
<Badge size="sm">Small</Badge>
<Badge size="md">Medium</Badge>
<Badge size="lg">Large</Badge> Formas
Las insignias pueden tener diferentes formas como píldora (pill, por defecto) o redondeada (rounded).
<Badge shape="pill">Pill</Badge>
<Badge shape="rounded">Rounded</Badge> Puntos (Dot)
Esto simplemente mostrará un punto de insignia, sin un conteo específico.
<Badge shape="dot" intent="primary" size="md" />
<Badge shape="dot" intent="success" size="md" />
<Badge shape="dot" intent="danger" size="md" />
<Badge shape="dot" intent="warning" size="md" />
<Badge shape="dot" intent="info" size="md" /> Independiente / Notificación
Usa la forma `notification` para indicadores numéricos como conteos de no leídos.
<Badge shape="notification" intent="danger" variant="solid">3</Badge>
<Badge shape="notification" intent="primary" variant="solid">+99</Badge> Posicionamiento
Las insignias pueden posicionarse absolutamente relativas a un contenedor padre usando la propiedad `position`.
<div class="relative w-12 h-12 bg-zinc-200 dark:bg-zinc-800 rounded-md flex items-center justify-center">
<Badge position="top-right" shape="notification" intent="danger" variant="solid">9</Badge>
</div>
<div class="relative w-12 h-12 bg-zinc-200 dark:bg-zinc-800 rounded-md flex items-center justify-center">
<Badge position="bottom-right" shape="dot" intent="success" size="lg" />
</div> API
| Propiedad | Descripción | Tipo | Por defecto |
|---|---|---|---|
| intent | The visual intent or color scheme of the badge. | "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "primary" |
| variant | The style variant of the badge. | "solid" | "outline" | "soft" | "soft" |
| size | The size of the badge. | "sm" | "md" | "lg" | "md" |
| shape | The geometric shape of the badge. | "rounded" | "pill" | "dot" | "notification" | "pill" |
| position | Positions the badge absolutely relative to its nearest positioned ancestor. | "top-right" | "bottom-right" | "top-left" | "bottom-left" | - |
| class | Additional CSS classes to apply to the badge. | string | - |