Bynder Open Source Projects

React Formulation

The Bynder React Formulation is an open source solution for easy form validation in React JavaSricpt applications. It was inspired by another open source project called react-reformed.


npm install @bynder/react-formulation --save


If you want to try out a little demo first, you can check it out here or try it yourself:

git clone [email protected]:Bynder/react-formulation.git
cd react-formulation
npm install
npm start


React Formulation offers two types of forms. The first one is a high order component for larger forms, the second one is a component for a form with just one input field and a submit and cancel button.


If you have a larger form you'll use the High order component:

import { withValidation, Validator } from '@bynder/react-formulation';

    validateOn: 'change', // optional, default value is 'blur'
    schema: {
        firstname: {
            required: true,
        lastname: {
            minLength: 2,
            maxLenght: 30,
        // ...more validation rules
class YourForm extends React.Component {
    componentWillMount() {
            firstname: 'Foo',
            lastname: 'Bar',

    onSubmit() {
        // handle submit

    render() {
        // Wrap your entire form in a <Validator.Form> component
        // Add a submit handler
        // Wrap every input in a <Validator> component
        // Provide a name to Validator (must match the name you provided in the schema)
        return (
            <Validator.Form onSubmit={this.onSubmit}>
                <Validator name="firstname">
                    <input />
                <Validator name="lastname">
                    <input />
                <button type="submit">Submit</submit>

export default YourForm;

Inline Form

For forms with just a single input you'll use the Inline Form component:

import { InlineForm } from '@bynder/react-formulation';

// Wrap your input and buttons in an <InlineForm> component.
// Provide the name of your input, validation rules, initial value,
// and optionally custom messages to this component.
// Add an onSubmit handler.
// Wrap the input in a <InlineForm.Field> component.
const YourInlineForm = () => (
            required: true,
            minLength: 2,
            maxLength: 30,
            // Custom validation messages
            required: 'Please don\'t leave me empty',
            minLength: condition => `Please use a minimum of ${condition} characters`,
        onSubmit={(val) => { // handle submit }}
        <InlineForm.Field resetOnEscape>
            <label htmlFor="inlineform-name">Name</label>
            <input id="inlineform-name" />
        <InlineForm.Errors /> // (optional) This will display the error messages
        <InlineForm.Cancel> // (optional) This will reset your form when you click cancel
            <button type="button">
        <InlineForm.Submit> // (optional) This disables the submit button if the field isn't valid
            <button type="submit">

export default YourInlineForm;

More information

GitHub repository:

npm page:

© 2023 Bynder All rights reserved. Digital Asset Management