All skills
inference-shell avatar

/widgets-ui

@b576e8e

Declarative UI widgets from JSON for React/Next.js from ui.inference.sh. Render rich interactive UIs from structured agent responses. Capabilities: forms, buttons, cards, layouts, inputs, selects, checkboxes. Use for: agent-generated UIs, dynamic forms, data display, interactive cards. Triggers: widgets, declarative ui, json ui, widget renderer, agent widgets, dynamic ui, form widgets, card widgets, shadcn widgets, structured output ui

Use this Skill: https://skilld.dev/gh/inference-shell/skills/widgets-ui

This session only. Nothing lands on disk.

SKILL.md

≈113 tokens always: the name and description. ≈1.1k when used: this file.

Install the belt CLI skill: npx skills add belt-sh/cli

Widget Renderer

Declarative UI from JSON via ui.inference.sh.

Widget Renderer

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

Component docs: ui.inference.sh/blocks/widgets

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides a declarative UI widget system for React and Next.js, allowing agents to render interactive components from JSON. It uses the vendor's own registry for component installation and follows standard practices for generative UI. No malicious patterns were identified.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    1 file scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at b576e8e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 5 months ago
  • React
  • Next.js
  • shadcn
  • ui-components
  • forms
  • json
  • declarative-ui
  • widget-renderer
  • dynamic-forms

README badge

README badge for inference-shell/skills/widgets-ui

Renders interactive UIs declaratively from JSON in React/Next.js apps using components from ui.inference.sh. Supports forms, buttons, cards, layouts, inputs, selects, and checkboxes—useful for displaying structured agent responses or building dynamic data-driven interfaces without hand-coding each component.

Generated from the current SKILL.md.

Does this work with React and Next.js?
Yes. The skill provides a WidgetRenderer component that integrates into React/Next.js projects and renders widgets from JSON.
What UI components are supported?
The skill includes layouts (row, col, box), typography (title, text, caption), interactive elements (button, input, textarea, select, checkbox), and display components (badge, icon, image, divider).
Can I use this to generate forms from agent responses?
Yes. You define a widget with asForm: true and pass children input/textarea/select/checkbox elements, then handle form submission via the onAction callback.
How do I install this?
Run `npx shadcn@latest add https://ui.inference.sh/r/widgets.json` or use `npx skills add belt-sh/cli` to install the belt CLI skill for use with agents.

Generated from the current SKILL.md. These answers refresh after source changes.