A wrapper container with options for cancel and save.
npm install @crave/farmblocks-form-wrapper
<FormWrapper
onCancel={e => console.log(e)}
onSave={e => console.log(e)}
title="Title"
extraContent={<div>Extra content</div>}
>
<Input label="First Name" />
<Input label="Last Name" />
</FormWrapper>
Output:
propery | type | description | required | default |
---|---|---|---|---|
title | string | The text to be used as the title | ||
cancelLabel | string | The text to be used in the Cancel link | Cancel | |
saveLabel | string | The text to be used by the Save button | Save | |
saveButtonProps | object | The props for Save button (check Button) | ||
onCancel | function | Callback of Cancel link click | Yes | |
onSave | function | Callback of Save button click | Yes | |
children | node | Contents to be rendered | Yes | |
extraContent | node | Contents to be rendered after Save button | ||
loading | boolean | Loading state to be passed to Save button | ||
id | string | id attribute given to the wrapper and to the save and cancel actionables (with -save and -cancel sufixes) | form-wrapper |
MIT
Version | Tag | Published |
---|---|---|
1.8.11 | latest | 2yrs ago |
1.8.11-alpha-adjust-xsmall-font-size-value-6142.1.0 | canary | 2yrs ago |
1.2.3-4209.1.8 | 4209.1 | 4yrs ago |
1.2.3-4208.1.8 | 4208.1 | 4yrs ago |