Selection
Blogging
Messaging
Map
Processing
Installation
$ pnpm dlx shadcn@latest add @mcpcn/status-badge
Usage
import {
StatusBadge,
StatusBadgeIcon,
StatusBadgeLabel,
} from "@/components/ui/status-badge";<StatusBadge>
<StatusBadgeIcon />
<StatusBadgeLabel />
</StatusBadge>Composition
Use the following composition to build an StatusBadge:
StatusBadge
├── StatusBadgeIcon
└── StatusBadgeLabelOpenUI Integration
Install the OpenUI React packages.
pnpm add @openuidev/react-lang zodAdd StatusBadge to a component library and map it to the installed component.
import { createLibrary, defineComponent } from "@openuidev/react-lang";
import { z } from "zod/v4";
import {
StatusBadge,
StatusBadgeIcon,
StatusBadgeLabel,
} from "@/components/ui/status-badge";
const OpenUIStatusBadge = defineComponent({
name: "StatusBadge",
description:
"Status badge with multiple states (success, pending, processing, error, shipped, delivered).",
props: z.object({}),
component: () => (
<StatusBadge>
<StatusBadgeIcon />
<StatusBadgeLabel />
</StatusBadge>
),
});
export const status_badgeLibrary = createLibrary({
root: "StatusBadge",
components: [OpenUIStatusBadge],
});For richer generated compositions, define the child primitives separately and connect them with .ref fields. See Defining Components in the OpenUI documentation.
json-render Integration
Install the json-render React packages.
pnpm add @json-render/core @json-render/react zodAdd StatusBadge to a component catalog and map it to the installed component.
import { defineCatalog } from "@json-render/core";
import { defineRegistry } from "@json-render/react";
import { schema } from "@json-render/react/schema";
import { z } from "zod";
import {
StatusBadge,
StatusBadgeIcon,
StatusBadgeLabel,
} from "@/components/ui/status-badge";
export const catalog = defineCatalog(schema, {
components: {
StatusBadge: {
props: z.object({}),
description:
"Status badge with multiple states (success, pending, processing, error, shipped, delivered).",
},
},
});
export const { registry } = defineRegistry(catalog, {
components: {
StatusBadge: () => (
<StatusBadge>
<StatusBadgeIcon />
<StatusBadgeLabel />
</StatusBadge>
),
},
});Use catalog.prompt() to constrain model output, then render the generated spec with the json-render React Renderer. See the json-render Quick Start for the provider and streaming setup.
API Reference
See the Base UI documentation for more information.