Vulcan/packages/nova-forms/README.md

45 lines
1,011 B
Markdown
Raw Normal View History

# React Forms
2016-04-04 11:30:14 +09:00
This package provides a `NovaForm` component that works with the schema extension defined in the [smart-methods](https://github.com/meteor-utilities/smart-methods) package to let you easily generate new document and edit document forms.
### Install
2016-04-04 11:30:14 +09:00
`meteor add nova:forms`
2016-04-04 11:30:14 +09:00
### Props
2016-04-04 11:30:14 +09:00
#### collection `object.isRequired`
2016-04-04 11:30:14 +09:00
The collection in which to edit or insert a document.
2016-04-04 11:30:14 +09:00
#### document `object`
2016-04-04 11:30:14 +09:00
If present, the document to edit. If not present, the form will be a “new document” form.
2016-04-04 11:30:14 +09:00
#### currentUser `object`
The current user.
#### submitCallback() `func`
A callback called on form submission.
#### successCallback(document) `func`
A callback called on method success.
#### errorCallback(document, error) `func`
A callback called on method failure.
#### methodName `string`
The name of the Meteor method to call.
#### labelFunction `func`
A function to call on field names to get the label.
#### prefilledProps `object`
A set of props to prefill for new documents.