widgets-ui▌
inferen-sh/skills · updated Apr 8, 2026
Render rich interactive UIs from JSON-structured widget definitions in React/Next.js.
- ›Supports 15+ widget types across layouts (row, col, box), typography (title, text, caption), interactive elements (button, input, select, checkbox), and display components (badge, icon, image, divider)
- ›Includes five preset gradients (ocean, sunset, purple, cool, midnight) for styled containers and flexible spacing/alignment options
- ›Handles form submission and click actions through a unified action h
Widget Renderer
Declarative UI from JSON via ui.inference.sh.

Quick Start
npx shadcn@latest add https://ui.inference.sh/r/widgets.json
Basic Usage
import { WidgetRenderer } from "@/registry/blocks/widgets/widget-renderer"
import type { Widget, WidgetAction } from "@/registry/blocks/widgets/types"
const widget: Widget = {
type: 'ui',
title: 'My Widget',
children: [
{ type: 'text', value: 'Hello World' },
{ type: 'button', label: 'Click me', onClickAction: { type: 'click' } },
],
}
<WidgetRenderer
widget={widget}
onAction={(action, formData) => console.log(action, formData)}
/>
Widget Types
Layout
{ "type": "row", "gap": 2, "children": [...] }
{ "type": "col", "gap": 2, "children": [...] }
{ "type": "box", "background": "gradient-ocean", "padding": 4, "radius": "lg", "children": [...] }
Typography
{ "type": "title", "value": "Heading", "size": "2xl", "weight": "bold" }
{ "type": "text", "value": "Body text", "variant": "bold" }
{ "type": "caption", "value": "Small text" }
{ "type": "label", "value": "Field label", "fieldName": "email" }
Interactive
{ "type": "button", "label": "Submit", "variant": "default", "onClickAction": { "type": "submit" } }
{ "type": "input", "name": "email", "placeholder": "Enter email" }
{ "type": "textarea", "name": "message", "placeholder": "Your message" }
{ "type": "select", "name": "plan", "options": [{ "value": "pro", "label": "Pro" }] }
{ "type": "checkbox", "name": "agree", "label": "I agree", "defaultChecked": false }
Display
{ "type": "badge", "label": "New", "variant": "secondary" }
{ "type": "icon", "iconName": "check", "size": "lg" }
{ "type": "image", "src": "https://...", "alt": "Image", "width": 100, "height": 100 }
{ "type": "divider" }
Example: Flight Card
const flightWidget: Widget = {
type: 'ui',
children: [
{
type: 'box', background: 'gradient-ocean', padding: 4, radius: 'lg', children: [
{
type: 'row', justify: 'between', children: [
{
type: 'col', gap: 1, children: [
{ type: 'caption', value: 'departure' },
{ type: 'title', value: 'SFO', size: '2xl', weight: 'bold' },
]
},
{ type: 'icon', iconName: 'plane', size: 'lg' },
{
type: 'col', gap: 1, align: 'end', children: [
{ type: 'caption', value: 'arrival' },
{ type: 'title', value: 'JFK', size: '2xl', weight: 'bold' },
]
},
]
},
]
},
],
}
Example: Form
const formWidget: Widget = {
type: 'ui',
title: 'Contact Form',
asForm: true,
children: [
{
type: 'col', gap: 3, children: [
{ type: 'input', name: 'name', placeholder: 'Your name' },
{ type: 'input', name: 'email', placeholder: 'Email address' },
{ type: 'textarea', name: 'message', placeholder: 'Message' },
{ type: 'button', label: 'Send', variant: 'default', onClickAction: { type: 'submit' } },
]
},
],
}
Gradients
| Name | Description |
|---|---|
gradient-ocean |
Blue teal gradient |
gradient-sunset |
Orange pink gradient |
gradient-purple |
Purple gradient |
gradient-cool |
Cool blue gradient |
gradient-midnight |
Dark blue gradient |
Handling Actions
const handleAction = (action: WidgetAction, formData?: WidgetFormData) => {
switch (action.type) {
case 'submit':
console.log('Form data:', formData)
break
case 'click':
console.log('Button clicked')
break
}
}
Related Skills
# Full agent component
npx skills add inference-sh/skills@agent-ui
# Chat UI blocks
npx skills add inference-sh/skills@chat-ui
# Tool UI
npx skills add inference-sh/skills@tools-ui
Documentation
- Widgets Overview - Understanding widgets
- Widget Schema - Widget JSON structure
- Agents That Generate UI - Building generative UIs
Component docs: ui.inference.sh/blocks/widgets
Ratings
4.8★★★★★58 reviews- ★★★★★Zara Gonzalez· Dec 20, 2024
widgets-ui has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Chaitanya Patil· Dec 16, 2024
widgets-ui reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Zara Lopez· Dec 16, 2024
widgets-ui is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Tariq Haddad· Dec 16, 2024
Useful defaults in widgets-ui — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Chinedu Bansal· Dec 8, 2024
I recommend widgets-ui for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Ren Okafor· Nov 27, 2024
widgets-ui reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Ren Mensah· Nov 11, 2024
widgets-ui fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Piyush G· Nov 7, 2024
I recommend widgets-ui for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Zara Bhatia· Nov 7, 2024
Registry listing for widgets-ui matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Shikha Mishra· Oct 26, 2024
Useful defaults in widgets-ui — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
showing 1-10 of 58