npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@formbridge/form-renderer

v0.2.0

Published

FormBridge form renderer with React components and hooks

Downloads

55

Readme

@formbridge/form-renderer

React component library for rendering FormBridge intake schemas as interactive forms with agent-human attribution tracking

License: MIT TypeScript

Overview

@formbridge/form-renderer provides a complete React toolkit for the FormBridge mixed-mode form system. It renders JSON Schema-based intake definitions as interactive forms, tracks which actor (agent or human) filled each field, and supports the full submission lifecycle including agent-to-human handoff and reviewer approval workflows.

Features

  • Schema-driven rendering — Automatically generates form fields from JSON Schema definitions
  • Field attribution — Visual badges show which actor (agent/human) filled each field
  • Agent-to-human handoffResumeFormPage loads submissions by resume token for human completion
  • Approval workflowReviewerView and ApprovalActions for review/approve/reject flows
  • Multi-step wizardsWizardForm with step validation, navigation, and progress tracking
  • 7 field types — String, Number, Boolean, Enum, Object, Array, and File fields
  • React hooksuseFormState, useValidation, useFormSubmission, useResumeSubmission
  • Built-in API client — Typed client for all FormBridge HTTP endpoints

Installation

npm install @formbridge/form-renderer

Peer dependencies:

npm install react react-dom

Quick Start

import { FormBridgeForm } from '@formbridge/form-renderer';
import '@formbridge/form-renderer/styles.css';

const schema = {
  type: 'object',
  properties: {
    companyName: { type: 'string', title: 'Company Name' },
    email: { type: 'string', format: 'email', title: 'Email' },
  },
  required: ['companyName', 'email'],
};

function MyForm() {
  return (
    <FormBridgeForm
      schema={schema}
      fields={{}}
      fieldAttribution={{}}
      currentActor={{ kind: 'human', id: 'user-1' }}
      onFieldChange={(path, value, actor) => console.log(path, value)}
      onSubmit={(fields) => console.log('Submit:', fields)}
    />
  );
}

Resume Flow (Agent-to-Human Handoff)

import { ResumeFormPage } from '@formbridge/form-renderer';

// Renders a full form from a resume token (typically from a URL like /resume?token=rt_xyz)
function ResumePage() {
  return (
    <ResumeFormPage
      endpoint="http://localhost:3000"
      onLoad={(submissionId) => console.log('Loaded:', submissionId)}
    />
  );
}

Approval Workflow

import { ReviewerView, ApprovalActions } from '@formbridge/form-renderer';

function ReviewPage({ submission, schema }) {
  const reviewer = { kind: 'human', id: '[email protected]' };

  return (
    <ReviewerView
      submission={submission}
      schema={schema}
      reviewer={reviewer}
      approvalActions={
        <ApprovalActions
          submissionId={submission.id}
          resumeToken={submission.resumeToken}
          reviewer={reviewer}
          onApprove={(data) => fetch('/approve', { method: 'POST', body: JSON.stringify(data) })}
          onReject={(data) => fetch('/reject', { method: 'POST', body: JSON.stringify(data) })}
        />
      }
    />
  );
}

API Surface

Components

| Component | Description | |-----------|-------------| | FormBridgeForm | Main form component — renders schema as interactive fields | | StringField | Text input (supports email, url, date, textarea formats) | | NumberField | Numeric input with min/max constraints | | BooleanField | Checkbox input | | EnumField | Select dropdown or radio group | | ObjectField | Nested field group | | ArrayField | List with add/remove controls | | FileField | File upload with drag-and-drop | | WizardForm | Multi-step progressive form | | ResumeFormPage | Agent-to-human handoff page | | ReviewerView | Read-only submission review | | ApprovalActions | Approve/reject/request-changes buttons | | ActorBadge | Visual actor attribution badge | | FieldWrapper | Field label, description, and error wrapper | | ErrorDisplay | Structured error display | | StepIndicator | Wizard step progress indicator |

Hooks

| Hook | Description | |------|-------------| | useFormState | Form data management with dirty tracking | | useValidation | Schema-based validation | | useFormSubmission | Full submission lifecycle (validate → submit → track) | | useResumeSubmission | Fetch submission by resume token | | useWizardNavigation | Wizard step state and navigation | | useConditions | Conditional field visibility |

API Client

| Export | Description | |--------|-------------| | FormBridgeApiClient | Typed HTTP client for FormBridge API | | createApiClient | Factory function | | defaultApiClient | Singleton client instance |

Styling

Import the default stylesheet:

import '@formbridge/form-renderer/styles.css';

All components accept a className prop. Default CSS classes use the formbridge- prefix.

Documentation

Full component and hook reference: React Form Renderer docs

Testing

cd packages/form-renderer
npx vitest run                    # Run all tests
npx vitest run src/components/    # Run component tests only

Tests use jsdom environment for DOM simulation.

Related Packages

  • @formbridge/schema-normalizer — Schema parsing and normalization
  • @formbridge/admin-dashboard — Admin UI for managing submissions
  • @formbridge/create-formbridge — Project scaffolding CLI