2,847 likes
mcpcn Building the future of agentic UIs, one component at a time.
2h
For the complete documentation index, see 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.
2,847 likes
mcpcn Building the future of agentic UIs, one component at a time.
2h
$ pnpm dlx shadcn@latest add @mcpcn/instagram-post
import {
InstagramPost,
InstagramPostActions,
InstagramPostCaption,
InstagramPostContent,
InstagramPostFooter,
InstagramPostHeader,
InstagramPostLikes,
InstagramPostMedia,
} from "@/components/ui/instagram-post";<InstagramPost>
<InstagramPostHeader />
<InstagramPostMedia />
<InstagramPostContent>
<InstagramPostActions />
<InstagramPostLikes />
<InstagramPostCaption />
<InstagramPostFooter />
</InstagramPostContent>
</InstagramPost>Use the following composition to build an InstagramPost:
InstagramPost
├── InstagramPostHeader
├── InstagramPostMedia
└── InstagramPostContent
├── InstagramPostActions
├── InstagramPostLikes
├── InstagramPostCaption
└── InstagramPostFooterInstall the OpenUI React packages.
pnpm add @openuidev/react-lang zodAdd InstagramPost to a component library and map it to the installed component.
import { createLibrary, defineComponent } from "@openuidev/react-lang";
import { z } from "zod/v4";
import {
InstagramPost,
InstagramPostActions,
InstagramPostCaption,
InstagramPostContent,
InstagramPostFooter,
InstagramPostHeader,
InstagramPostLikes,
InstagramPostMedia,
} from "@/components/ui/instagram-post";
const OpenUIInstagramPost = defineComponent({
name: "InstagramPost",
description: "Instagram post card with image and engagement.",
props: z.object({}),
component: () => (
<InstagramPost>
<InstagramPostHeader />
<InstagramPostMedia />
<InstagramPostContent>
<InstagramPostActions />
<InstagramPostLikes />
<InstagramPostCaption />
<InstagramPostFooter />
</InstagramPostContent>
</InstagramPost>
),
});
export const instagram_postLibrary = createLibrary({
root: "InstagramPost",
components: [OpenUIInstagramPost],
});For richer generated compositions, define the child primitives separately and connect them with .ref fields. See Defining Components in the OpenUI documentation.
Install the json-render React packages.
pnpm add @json-render/core @json-render/react zodAdd InstagramPost 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 {
InstagramPost,
InstagramPostActions,
InstagramPostCaption,
InstagramPostContent,
InstagramPostFooter,
InstagramPostHeader,
InstagramPostLikes,
InstagramPostMedia,
} from "@/components/ui/instagram-post";
export const catalog = defineCatalog(schema, {
components: {
InstagramPost: {
props: z.object({}),
description: "Instagram post card with image and engagement.",
},
},
});
export const { registry } = defineRegistry(catalog, {
components: {
InstagramPost: () => (
<InstagramPost>
<InstagramPostHeader />
<InstagramPostMedia />
<InstagramPostContent>
<InstagramPostActions />
<InstagramPostLikes />
<InstagramPostCaption />
<InstagramPostFooter />
</InstagramPostContent>
</InstagramPost>
),
},
});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.
See the Base UI documentation for more information.