Socket
Book a DemoInstallSign in
Socket

@publicodes/forms

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@publicodes/forms

Utilities to convert publicodes rules in interactive forms

0.6.0
latest
Source
npmnpm
Version published
Maintainers
4
Created
Source

This library exports utilities to create interactive forms and simulators from publicodes rules.

This library is framework-agnostic and can be used with any state management system:

  • React useState
  • Redux
  • Svelte stores
  • Vue reactive system
  • etc.

Usage

// Create a form builder
const engine = new Engine(rules)
const formBuilder = new FormBuilder({ engine })

// Initialize form state
let state = FormBuilder.newState()
state = formBuilder.start(state, 'target . rule')

// Get current page UI elements
const formElements = formBuilder.currentPage(state)

// Handle user input
state = formBuilder.handleInputChange(state, 'rule . name', 'new value')

// Navigate pages
state = formBuilder.goToNextPage(state)
state = formBuilder.goToPreviousPage(state)

// Get pagination information
const { current, pageCount, hasNextPage, hasPreviousPage } =
    formBuilder.pagination(state)

Getting started

npm install publicodes publicodes-form

Then follow the guide to create a simple page.

FAQs

Package last updated on 07 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.