-
Notifications
You must be signed in to change notification settings - Fork 0
Using custom form buttons
Patrick Sachs edited this page Aug 6, 2018
·
6 revisions
The default form provides two buttons out of the box: A submit button, and a reset button.
While these buttons certainly serve their purpose some forms require more buttons, or you might want to adjust the text of them(How dare you not want emojis on your production corporate website!).
Adjusting the default buttons is the easiest task. The react-formilicious/defaultButtons module contains our default buttons, which we can then adjust:
import * as defaultButtons from "react-formilicious/defaultButtons";
defaultButtons.submit.name = "π¨βπ Beam the data up!";
defaultButtons.reset.name = "π₯ We can do better, reset!";We can also override all buttons all together if so desired:
import * as defaultButtons from "react-formilicious/defaultButtons";
defaultButtons.setButtons([
{
key: "my-awesome-save-button",
name: "πΎ I ain't need no defaults!",
action: "save",
type: "info"
}
]);

