Vulcan/packages/nova-forms/README.md
2016-04-04 11:30:14 +09:00

45 lines
No EOL
1,011 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# React Forms
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
`meteor add nova:forms`
### Props
#### collection `object.isRequired`
The collection in which to edit or insert a document.
#### document `object`
If present, the document to edit. If not present, the form will be a “new document” form.
#### 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.