@contentful/default-field-editors
TypeScript icon, indicating that this package has built-in type declarations

1.7.80 • Public • Published

@contentful/default-field-editors

npm install @contentful/default-field-editors

This package provides React components for rendering all supported field editors with the same structure and style as in Contentful web app.

Example

import 'codemirror/lib/codemirror.css';
import '@contentful/field-editor-date/styles/styles.css';
import { Field, FieldWrapper } from 'packages/default-field-editors';

const fieldEditor = (
  <FieldWrapper sdk={FieldAppSDK} name={fieldName}>
    <Field sdk={FieldAppSDK} widgetId="singleLine" />
  </FieldWrapper>
);

It is optional to specify widgetId, and when not specified we'll try to determine a default editor type to render based on the field configuration.

Otherwise, you can set it to one of many available editor types: singleLine for a single line text editor, checkbox for a checkbox input, etc.

You can see the full list of supported widgets in the WidgetType type definition.

/@contentful/default-field-editors/

    Package Sidebar

    Install

    npm i @contentful/default-field-editors

    Weekly Downloads

    3,673

    Version

    1.7.80

    License

    MIT

    Unpacked Size

    45.4 kB

    Total Files

    30

    Last publish

    Collaborators

    • it-internal
    • whydah-gally
    • contentful-ecosystem
    • michaelpearce