
Directives
A ready-made collection of seven directives for json-render that handle the repetitive stuff: formatting dates and currency with $format, basic arithmetic with $math, string operations like $concat and $truncate, and pluralization. The i18n factory is there if you need localization. They compose naturally, so you can nest a $math operation inside a $format directive without ceremony. Wire them into your renderer's provider or spread the array if you need to add custom ones. Saves you from writing the same defineDirective boilerplate every time you need to format a price or count array items in your specs.
- skills.sh installs
- 8.1K
- GitHub stars
- 19.5K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add vercel-labs/json-render --skill directives --agent claude-codeInstalls into .claude/skills of the current project.
Files
@json-render/directives
Pre-built custom directives for @json-render/core. Drop them into your catalog and renderer to add formatting, math, string manipulation, and i18n.
Quick Start
import { standardDirectives } from '@json-render/directives';
// Wire into prompt generation
const prompt = catalog.prompt({ directives: standardDirectives });
// Wire into the renderer (React example)
import { JSONUIProvider, Renderer } from '@json-render/react';
<JSONUIProvider registry={registry} directives={standardDirectives}>
<Renderer spec={spec} registry={registry} />
</JSONUIProvider>
To add factory directives like createI18nDirective, spread the array:
import { standardDirectives, createI18nDirective } from '@json-render/directives';
const directives = [...standardDirectives, createI18nDirective(config)];
Defining Custom Directives
Use defineDirective from @json-render/core:
import { defineDirective, resolvePropValue } from '@json-render/core';
import { z } from 'zod';
Sponsors
Details
- Repository
- github.com/vercel-labs/json-render
- Categories
- Code Review & Quality, Cloud & Infrastructure
- First seen
- Jul 14, 2026
More from vercel-labs/json-render
All 31- Mcp5.9K
- React Native3.3K
- Shadcn2.5K
- React Three Fiber2.4K
- React Pdf2.4K
- Zustand1.9K
- Remotion1.8K
- Image1.6K
- Remotion Best Practices1.6K
- Vue1.4K
- React Email1.4K
- Skill Creator1.4K
- Ink1.3K
- Svelte1.2K
- Shadcn Svelte1.2K
- Redux1.1K
- Jotai1.1K
- Xstate1.1K
- Solid1.1K
- Yaml1.1K
- Json Render React391
- Json Render Core340
- Json Render Shadcn213
- Json Render Remotion153