sp-react-formfields

Collection of React controls used for rendering SharePoint fields in custom forms. Support new/edit/display rendering modes.

Usage no npm install needed!

<script type="module">
  import spReactFormfields from 'https://cdn.skypack.dev/sp-react-formfields';
</script>

README

sp-react-formfields NPM version Build Status

Collection of React controls used for rendering SharePoint fields in custom forms. Supports new/edit/display rendering modes. Also includes a panel ListForm component that expects a ListId, FormMode, and optionally ItemId and ContentTypeId parameters

Installation

$ npm install --save sp-react-formfields

Usage

import { ListForm } from 'sp-react-formfields/lib/ListForm';
import { FormField } from 'sp-react-formfields/lib/fields/FormField';
import { FormFieldLabel } from 'sp-react-formfields/lib/fields/FormFieldLabel';
import { FormMode, getQueryString, IListFormProps } from 'sp-react-formfields/lib/interfaces'

Main usage is

  1. rendering ListForm component as top level parent
  2. passing ListId, FormMode, ItemId, ContentTypeId properties to ListForm
  3. if ListForm does not have any chldren inside - means all fields for current list or content type will be rendered, or you can specify any number of custom JSX and FormField / FormFieldLabel components inside, passing InternalName string to each.

Advanced usage with asynchronous component loading that significantly reduces initial load time is provided in the scaffolding project below.

Please refer to sp-listform-react scaffolding project to get you started quickly

The project is generated using Andrew Koltyakov's incredible SharePoint Push-n-Pull Yeoman generator

The end product of the scaffolded solution will be a series of JS, CSS and HTML files that will be easitly uploadable into SharePoint environment and will act as content for embedding in CEWPs

License

MIT © Oleg Rumiancev