$npx -y skills add vercel-labs/json-render --skill shadcnPre-built shadcn/ui components for json-render. Use when working with @json-render/shadcn, adding standard UI components to a catalog, or building web UIs with Radix UI + Tailwind CSS components.
| 1 | # @json-render/shadcn |
| 2 | |
| 3 | Pre-built shadcn/ui component definitions and implementations for json-render. Provides 36 components built on Radix UI + Tailwind CSS. |
| 4 | |
| 5 | ## Two Entry Points |
| 6 | |
| 7 | | Entry Point | Exports | Use For | |
| 8 | |-------------|---------|---------| |
| 9 | | `@json-render/shadcn/catalog` | `shadcnComponentDefinitions` | Catalog schemas (no React dependency, safe for server) | |
| 10 | | `@json-render/shadcn` | `shadcnComponents` | React implementations | |
| 11 | |
| 12 | ## Usage Pattern |
| 13 | |
| 14 | Pick the components you need from the standard definitions. Do not spread all definitions -- explicitly select what your app uses: |
| 15 | |
| 16 | ```typescript |
| 17 | import { defineCatalog } from "@json-render/core"; |
| 18 | import { schema } from "@json-render/react/schema"; |
| 19 | import { shadcnComponentDefinitions } from "@json-render/shadcn/catalog"; |
| 20 | import { defineRegistry } from "@json-render/react"; |
| 21 | import { shadcnComponents } from "@json-render/shadcn"; |
| 22 | |
| 23 | // Catalog: pick definitions |
| 24 | const catalog = defineCatalog(schema, { |
| 25 | components: { |
| 26 | Card: shadcnComponentDefinitions.Card, |
| 27 | Stack: shadcnComponentDefinitions.Stack, |
| 28 | Heading: shadcnComponentDefinitions.Heading, |
| 29 | Button: shadcnComponentDefinitions.Button, |
| 30 | Input: shadcnComponentDefinitions.Input, |
| 31 | }, |
| 32 | actions: {}, |
| 33 | }); |
| 34 | |
| 35 | // Registry: pick matching implementations |
| 36 | const { registry } = defineRegistry(catalog, { |
| 37 | components: { |
| 38 | Card: shadcnComponents.Card, |
| 39 | Stack: shadcnComponents.Stack, |
| 40 | Heading: shadcnComponents.Heading, |
| 41 | Button: shadcnComponents.Button, |
| 42 | Input: shadcnComponents.Input, |
| 43 | }, |
| 44 | }); |
| 45 | ``` |
| 46 | |
| 47 | > State actions (`setState`, `pushState`, `removeState`) are built into the React schema and handled by `ActionProvider` automatically. No need to declare them. |
| 48 | |
| 49 | ## Extending with Custom Components |
| 50 | |
| 51 | Add custom components alongside standard ones: |
| 52 | |
| 53 | ```typescript |
| 54 | const catalog = defineCatalog(schema, { |
| 55 | components: { |
| 56 | // Standard |
| 57 | Card: shadcnComponentDefinitions.Card, |
| 58 | Stack: shadcnComponentDefinitions.Stack, |
| 59 | |
| 60 | // Custom |
| 61 | Metric: { |
| 62 | props: z.object({ |
| 63 | label: z.string(), |
| 64 | value: z.string(), |
| 65 | trend: z.enum(["up", "down", "neutral"]).nullable(), |
| 66 | }), |
| 67 | description: "KPI metric display", |
| 68 | }, |
| 69 | }, |
| 70 | actions: {}, |
| 71 | }); |
| 72 | |
| 73 | const { registry } = defineRegistry(catalog, { |
| 74 | components: { |
| 75 | Card: shadcnComponents.Card, |
| 76 | Stack: shadcnComponents.Stack, |
| 77 | Metric: ({ props }) => <div>{props.label}: {props.value}</div>, |
| 78 | }, |
| 79 | }); |
| 80 | ``` |
| 81 | |
| 82 | ## Available Components |
| 83 | |
| 84 | ### Layout |
| 85 | - **Card** - Container with optional title, description, maxWidth, centered |
| 86 | - **Stack** - Flex container with direction, gap, align, justify |
| 87 | - **Grid** - Grid layout with columns (number) and gap |
| 88 | - **Separator** - Visual divider with orientation |
| 89 | |
| 90 | ### Navigation |
| 91 | - **Tabs** - Tabbed navigation with tabs array, defaultValue, value |
| 92 | - **Accordion** - Collapsible sections with items array and type (single/multiple) |
| 93 | - **Collapsible** - Single collapsible section with title |
| 94 | - **Pagination** - Page navigation with totalPages and page |
| 95 | |
| 96 | ### Overlay |
| 97 | - **Dialog** - Modal dialog with title, description, openPath |
| 98 | - **Drawer** - Bottom drawer with title, description, openPath |
| 99 | - **Tooltip** - Hover tooltip with content and text |
| 100 | - **Popover** - Click-triggered popover with trigger and content |
| 101 | - **DropdownMenu** - Dropdown with label and items array |
| 102 | |
| 103 | ### Content |
| 104 | - **Heading** - Heading text with level (h1-h4) |
| 105 | - **Text** - Paragraph with variant (body, caption, muted, lead, code) |
| 106 | - **Image** - Image with alt, width, height |
| 107 | - **Avatar** - User avatar with src, name, size |
| 108 | - **Badge** - Status badge with text and variant (default, secondary, destructive, outline) |
| 109 | - **Alert** - Alert banner with title, message, type (success, warning, info, error) |
| 110 | - **Carousel** - Scrollable carousel with items array |
| 111 | - **Table** - Data table with columns (string[]) and rows (string[][]) |
| 112 | |
| 113 | ### Feedback |
| 114 | - **Progress** - Progress bar with value, max, label |
| 115 | - **Skeleton** - Loading placeholder with width, height, rounded |
| 116 | - **Spinner** - Loading spinner with size and label |
| 117 | |
| 118 | ### Input |
| 119 | - **Button** - Button with label, variant (primary, secondary, danger), disabled |
| 120 | - **Link** - Anchor link with label and href |
| 121 | - **Input** - Text input with label, name, type, placeholder, value, checks |
| 122 | - **Textarea** - Multi-line input with label, name, placeholder, rows, value, checks |
| 123 | - **Select** - Dropdown select with label, name, options (string[]), value, checks |
| 124 | - **Checkbox** - Checkbox with label, name, checked, checks, validateOn |
| 125 | - **Radio** - Radio group with label, name, options (string[]), value, checks, validateOn |
| 126 | - **Switch** - Toggle switch with label, name, checked, checks, validateOn |
| 127 | - **Slider** - Range slider with label, min, max, step, value |
| 128 | - **Toggle** - Toggle button with label, pressed, variant |
| 129 | - **ToggleGroup** - G |