Put a BadgeImage in the icon slot of the badge, then the text that names the thing, so the picture can stay decorative.
The sample also uses badge-image. One command adds them with this item:
source-pills.tsx
Badge
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| rounded | "default""full" | "full" | |
| size | "default""lg" | "default" | |
| variant | "dashed""default""destructive""ghost""info""link""media""outline""secondary""success""warning" | "default" | |
From Base UIUseRenderBase UI docs | |||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
BadgeImage
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | Blob | — | The file: an address, or a Blob (a File a person dropped, shown through an object URL that is freed with the file). With no src, the box shows the fallback at once and loads nothing. |
| src | string | — | A ready srcset for src ("a-640.jpg 640w, a-1280.jpg 1280w"), with sizes: for files that a server already made at each width. It wins over loader and transformer. Change it together with src: the old picture keeps only its src while the new one loads. |
| sizes | string | — | The sizes of the srcset: how wide the box is per screen ("(max-width: 640px) 100vw, 33vw"). |
| loader | ImageLoader | — | Makes the URL of each srcset width, Next.js style. Default: the loader of the nearest ImageLoaderProvider (none outside one). |
| transformer | ImageTransformer | — | An Unpic provider transformer, an alternative to loader. |
| quality | number | — | The quality that loader and transformer get (1–100). |
| preload | boolean | — | A picture above the fold (a hero): loads at once with a high fetch priority, and React preloads it (<link rel="preload"> with the srcset). Default false: lazy. |
| placeholder | "none" | What shows while the file loads: muted (default, the muted box), skeleton (the box with a shimmer band), blur (blurDataURL, blurred), color (placeholderColor), none (no fill, also on an error: the parent shows), or an element: your own layer under the file until its fade ends (a sharp thumbnail of the same picture). | |
| blur | string | — | A tiny copy of the picture (10px or less, a data URL) for placeholder="blur". |
| placeholder | string | — | The main color of the picture for placeholder="color" (a data color). |
| position | string | — | The CSS object-position of the picture in the box ("top", "30% 60%"). |
| fade | boolean | false | Fade the file in when it loads. Default true. A file the page already loaded, or a server file, shows at once. |
| on | — | Called with the new status: idle, loading, loaded, error. | |
| on | — | ||
| on | — | ||
| class | string | — | The classes of the box (size, corners, ratio). |
| img | string | — | The classes of the <img>. |
| style | CSSProperties | — | |
| children | ReactNode | — | An ImageFallback for the error and the no-src box. Default: an icon (none for alt=""). With a child, the root is not role="img": the fallback speaks for itself, and an img role would hide its words and controls (a retry button) from screen readers. |
| alt | string | "" | Default "": the badge text names the thing. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
- DotA small color dot next to a status word or a chart series. It can pulse to show that something runs now.
- ButtonA button for an action on the page, such as Save or Delete. It has 9 looks and 5 sizes, and a spinner that keeps its width while the action runs.
- KbdShows a key or a shortcut in text, such as a search hint, a shortcut in a menu, or a key in help text.
- Tag GroupPick Tag Group for a set of tags that people focus, remove, or pick as filters.







