Field Legos

Field legos are used to define a field used within a form lego.

Github (opens in a new tab)

Usage

Examples

How to make a field lego

import { MolochFieldLego } from '@daohaus/moloch-v3-fields';
 
const customField = {
  id: 'customId',
  type: 'input',
  label: 'I am custom',
  placeholder: 'just holding a place',
  expectType: 'url',
};

Field types can be added when creating custom moloch-v3-fields. Here are the existing fields (opens in a new tab).

expectType automatically validates input values. There are a few ValidateField (opens in a new tab) options for this available out of the box:

  • number
  • boolean
  • array
  • ethAddress
  • url
  • email
  • percent
  • object