From c62c4f56e58a2cefd5d7d4433f0fac70d0097301 Mon Sep 17 00:00:00 2001 From: Shawn Erquhart Date: Fri, 12 Jan 2018 11:09:17 -0500 Subject: [PATCH] =?UTF-8?q?Update=20Docs=20=E2=80=9Ccustom-widgets?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/site/content/docs/custom-widgets.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/site/content/docs/custom-widgets.md b/website/site/content/docs/custom-widgets.md index ace52586..fab31589 100644 --- a/website/site/content/docs/custom-widgets.md +++ b/website/site/content/docs/custom-widgets.md @@ -4,7 +4,7 @@ position: 35 --- # Custom Widgets -The NetlifyCMS exposes a `window.CMS` global object that you can use to register custom widgets, previews, and editor plugins. The available widget extension methods are: +The NetlifyCMS exposes a `window.CMS` global object that you can use to register custom widgets, previews, and editor plugins. The same object is also the default export if you import Netify CMS as an npm module. The available widget extension methods are: * **registerWidget:** lets you register a custom widget. * **registerEditorComponent:** lets you add a block component to the Markdown editor. @@ -20,7 +20,7 @@ However, although possible, it may be cumbersome or even impractical to add a Re Register a custom widget. ```js -CMS.registerWidget(name, control, \[preview\]) +// Using global window objectCMS.registerWidget(name, control, [preview])// Using npm module importimport CMS from 'netlify-cms'CMS.registerWidget(name, control, [preview]) ``` **Params:** @@ -28,7 +28,7 @@ CMS.registerWidget(name, control, \[preview\]) | Param | Type | Description | | ----------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | string | Widget name, allows this widget to be used via the field `widget` property in config | -| `control` | React.Component \| string | | +| `control` | React.Component | string | | | [`preview`] | React.Component, optional | Renders the widget preview, receives the following props: | * **field:** The field type that this widget will be used for.