@daohaus/wizard-form-builder
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

@daohaus/wizard-form-builder

The Wizard Form Builder library is an extension of the Form Builder and enables multi-step form building.

Related packages

Usage

Installation

yarn add @daohaus/wizardform-builder

How to add to you application

import { WizardFormBuilder } from '@daohaus/form-builder';
import { MolochFields } from '@daohaus/moloch-v3-fields';

import { TARGET_DAO } from '../targetDao';

const WIZARD_FORM_LEGO = {
  id: 'WIZZ',
  tx: TX.SOME_TX_LEGO,
  log: true,
  submitButtonText: 'Deploy',
  confirmTitle: 'Review Data',
  confirmDescription: 'These settings cannot be changed once on-chain. Some other confirmation text.',
  steps: [
    {
      id: 'stepOne',
      title: 'Name Your DAO',
      description: 'You are summoning a Moloch DAO. Enter a name for your on-chain organization.  ',
      fields: [
        {
          type: 'input',
          id: 'daoName',
          label: 'DAO',
          placeholder: 'Name',
          rules: {
            maxLength: {
              value: 128,
              message: 'DAO name must be 128 characters or less',
            },
          },
        },
      ],
      requiredFields: { daoName: true },
    },
    {
      id: 'stepTwo',
      title: 'Describe Your DAO',
      description: 'What does your DAO do?',
      fields: [
        {
          type: 'textarea',
          id: 'daoDescription',
          label: 'Description',
          placeholder: 'Description',
        },
      ],
      requiredFields: { daoDescription: true },
    },
  ],
};

export const FormPage = () => {
  return <WizardFormBuilder form={WIZARD_FORM_LEGO} targetNetwork={'0x5'} customFields={MolochFields} />;
};

Readme

Keywords

none

Package Sidebar

Install

npm i @daohaus/wizard-form-builder

Weekly Downloads

5

Version

0.2.1

License

none

Unpacked Size

81.2 kB

Total Files

10

Last publish

Collaborators

  • daohaus-protocol