FeedbackBadge
Searchastronomic.dev# Badge For a short status next to other content, like whether you are taking new work. Static: no JavaScript. ## Usage ```astro import Badge from "@astronomic-dev/ui/components/Badge.astro"; ``` ## Examples ### Statuses ```astro --- import Badge from "@astronomic-dev/ui/components/Badge.astro"; --- <div class="flex flex-wrap items-center gap-3"> <Badge status="positive">Taking new projects from February</Badge> <Badge status="caution">Limited availability</Badge> <Badge>Closed until spring</Badge> </div> ``` ### Plain, in a line of text variant="plain": the dot and the text only, in the size, weight and color of the text around it. ```astro --- import Badge from "@astronomic-dev/ui/components/Badge.astro"; --- <p class="m-0 text-body text-fg"> Studio status: <Badge variant="plain" status="positive">Taking new projects from February</Badge> </p> ``` ## Props ### Badge | Prop | Type | Default | Description | | --- | --- | --- | --- | | `status` | `"neutral" \| "positive" \| "caution"` | `"neutral"` | The state. Sets the dot: `positive` is a filled accent dot, `caution` an accent ring, `neutral` a muted dot. | | `variant` | `"pill" \| "plain"` | `"pill"` | `pill`: a small label with its own fill and edge, so it reads on a page, a band or an image. `plain`: the dot and the text only, in the size, weight and color of the text around it. | | `dot` | `boolean` | None | Shows the dot. By default it is on for `positive` and `caution`, off for `neutral`. | | `class` | `string` | None | More classes, merged with cn(), so yours win on conflicts. | | Slot | Description | | --- | --- | | `default` | The text. It must say the state; the dot is decoration. | Any other attribute goes on the <span>. ## Accessibility - Renders a <span> with no role; the text is what a screen reader reads. - The dot is hidden from screen readers and its status is only a look, so the text must say the state.
Badge
FreeFor a short status next to other content, like whether you are taking new work.
- File
- Badge.astro
- Group
- Feedback
- Kind
- Static: no JavaScript
- Examples
- 2
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Statuses
Taking new projects from FebruaryLimited availabilityClosed until spring
Force statemain.astro
examples/badge/main.astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
---
<div class="flex flex-wrap items-center gap-3">
<Badge status="positive">Taking new projects from February</Badge>
<Badge status="caution">Limited availability</Badge>
<Badge>Closed until spring</Badge>
</div>Plain, in a line of text
variant="plain": the dot and the text only, in the size, weight and color of the text around it.
Studio status: Taking new projects from February
Force stateplain.astro
examples/badge/plain.astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
---
<p class="m-0 text-body text-fg">
Studio status: <Badge variant="plain" status="positive">Taking new projects from February</Badge>
</p>Minimal · Light