Skip to content
aq-ui
Back to ComponentsComponent

Badge

Open-code aq-ui accessible component family for Badge.

Preview

This is a live example. Interact with the available controls and use the keyboard to inspect the component's states and behavior.

Loading interactive preview…

Installation

pnpm dlx aq-ui@alpha add badge

API reference

SSR-safe

Import the parts you need, then jump to an export for its contract.

View full source

Quick start

import { Badge } from "@/components/ui/badge"

<Badge />

Badge

constSource L31

Open-code aq-ui accessible component family for Badge.

const Badge = React.forwardRef<React.ComponentRef<"span">, useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>>(…)
Props type
useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>
<Badge />

badgeVariants

constSource L8

Public const export from Badge.

const badgeVariants = cva(…)

Registry dependencies

utils

Package dependencies

@base-ui/react@^1.7.0, class-variance-authority@^0.7.1

Files

  • components/ui/badge.tsx

Source