API Reference
Copy for LLM View Markdown Pre-built shadcn/ui components for json-render. 36 components built on Radix UI + Tailwind CSS, ready to use with defineCatalog and defineRegistry.
npm install @json-render/shadcn @json-render/core @json-render/react zod
Your app must have Tailwind CSS configured.
Entry Point Exports Use For @json-render/shadcnshadcnComponentsReact implementations @json-render/shadcn/catalogshadcnComponentDefinitionsCatalog schemas (no React dependency, safe for server)
Pick the components you need from the standard definitions:
import { defineCatalog } from " @json-render/core " ;
import { schema } from " @json-render/react/schema " ;
import { shadcnComponentDefinitions } from " @json-render/shadcn/catalog " ;
import { defineRegistry } from " @json-render/react " ;
import { shadcnComponents } from " @json-render/shadcn " ;
// Catalog: pick definitions
const catalog = defineCatalog (schema , {
components : {
Card : shadcnComponentDefinitions . Card ,
Stack : shadcnComponentDefinitions . Stack ,
Heading : shadcnComponentDefinitions . Heading ,
Button : shadcnComponentDefinitions . Button ,
Input : shadcnComponentDefinitions . Input ,
},
actions : {},
} ) ;
// Registry: pick matching implementations
const { registry } = defineRegistry (catalog , {
components : {
Card : shadcnComponents . Card ,
Stack : shadcnComponents . Stack ,
Heading : shadcnComponents . Heading ,
Button : shadcnComponents . Button ,
Input : shadcnComponents . Input ,
},
} ) ;
State actions (setState, pushState, removeState) are built into the React schema and handled by ActionProvider automatically. You don't need to declare them in your catalog.
Add custom components alongside standard ones:
import { z } from " zod " ;
const catalog = defineCatalog (schema , {
components : {
// Standard
Card : shadcnComponentDefinitions . Card ,
Stack : shadcnComponentDefinitions . Stack ,
Button : shadcnComponentDefinitions . Button ,
// Custom
Metric : {
props : z . object ( {
label : z . string () ,
value : z . string () ,
trend : z . enum ([ " up " , " down " , " neutral " ]) . nullable () ,
} ) ,
description : " KPI metric display " ,
},
},
actions : {},
} ) ;
const { registry } = defineRegistry (catalog , {
components : {
Card : shadcnComponents . Card ,
Stack : shadcnComponents . Stack ,
Button : shadcnComponents . Button ,
Metric : ({ props }) => (
< div >
< span > { props.label } </ span >
< span > { props.value } </ span >
</ div >
) ,
},
} ) ;
Component Description CardContainer card with optional title, description, maxWidth, centered StackFlex container with direction, gap, align, justify GridGrid layout with columns (1-6) and gap SeparatorVisual separator line with orientation
Component Description TabsTabbed navigation with tabs array, defaultValue, value AccordionCollapsible sections with items array and type (single/multiple) CollapsibleSingle collapsible section with title and defaultOpen PaginationPage navigation with totalPages and page
Component Description DialogModal dialog with title, description, openPath DrawerBottom drawer with title, description, openPath TooltipHover tooltip with content and text PopoverClick-triggered popover with trigger and content DropdownMenuDropdown menu with label and items array
Component Description HeadingHeading text with level (h1-h4) TextParagraph with variant (body, caption, muted, lead, code) ImageImage with alt, width, height AvatarUser avatar with src, name, size BadgeStatus badge with text and variant AlertAlert banner with title, message, type CarouselHorizontally scrollable carousel with items TableData table with columns and rows
Component Description ProgressProgress bar with value, max, label SkeletonLoading placeholder with width, height, rounded SpinnerLoading spinner with size and label
Component Description ButtonClickable button with label, variant, disabled LinkAnchor link with label and href InputText input with label, name, type, placeholder, value, checks TextareaMulti-line text input with label, name, placeholder, rows, value, checks SelectDropdown select with label, name, options, value, checks CheckboxCheckbox with label, name, checked RadioRadio button group with label, name, options, value SwitchToggle switch with label, name, checked SliderRange slider with label, min, max, step, value ToggleToggle button with label, pressed, variant ToggleGroupGroup of toggle buttons with items, type, value ButtonGroupGroup of buttons with buttons array and selected
The /catalog entry point has no React dependency -- use it for server-side prompt generation
Components use Tailwind CSS classes -- your app must have Tailwind configured
Component implementations use bundled shadcn/ui primitives (not your app's components/ui/)
Form inputs support checks for validation (type + message pairs)
Events: inputs emit change/submit/focus/blur; buttons emit press; selects emit change/select