# TagCloud

> Tags in a wrapping row, each set larger the more posts carry it, in steps between the least and most used, built from parts: the caller writes each tag and chooses whether its count shows.

```ts
import { TagCloud } from "@sdxc/ui/blog";
```

Renders the cloud as a wrapping `<ul>` of its tags, sharing `range`, `steps` and `scale` so
each TagCloud.Tag sizes itself. Recolour or turn the tags into chips through
TagCloud.CustomProperties.

## Examples

```tsx
<TagCloud range={{ least: 1, most: 12 }}>
	<TagCloud.Tag href="/tags/caching" count={12}>
		caching <TagCloud.Count /> <TagCloud.CountLabel>(12 posts)</TagCloud.CountLabel>
	</TagCloud.Tag>
</TagCloud>
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `range?` | `Range` | The least and most used tags' counts; without it every tag sits on the middle step. |
| `steps?` | `number` | How many sizes lie between the least- and most-used tag; a larger number approaches a continuous scale. |
| `scale?` | `number` | Multiplies every size, for a page where the cloud is the content. |

Also accepts everything in `ElementProps<"ul">`.


### TagCloud.Tag

One tag as a list item and link, carrying its weight step (1 to `steps`) in `data-weight` and a font size to match, semibold in the top steps; on the middle step when the cloud has no range or every count is equal.

Takes no props of its own.

### TagCloud.Count

The tag's count as a small number beside its name, hidden from screen readers, which hear the words in TagCloud.CountLabel instead.

Also accepts everything in `Omit<ElementProps<"span">, "children">`.


### TagCloud.CountLabel

The count in words for screen readers only, such as "(12 posts)", so the size difference is never the only way to tell tags apart.

Also accepts everything in `ElementProps<"span">`.

