# Badge

A macOS sidebar count badge.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).



<ComponentPreview name="badge/Basic" />

## Import [#import]

```rust
use maccn::MacBadge;
```

## Usage [#usage]

```rust
MacBadge::new("count").child("12");
```

## API [#api]

### Constructor [#constructor]

| Method              | Description                                    |
| ------------------- | ---------------------------------------------- |
| `MacBadge::new(id)` | Creates a new badge with the given element ID. |

### Traits [#traits]

| Trait           | Description                               |
| --------------- | ----------------------------------------- |
| `Styled`        | Set background, text color, padding, etc. |
| `ParentElement` | Add content via `.child()`.               |
