JSPM

  • Created
  • Published
  • Downloads 1395
  • Score
    100M100P100Q107412F
  • License GPL-2.0-or-later

UI components for use in Gravity Forms development. Both React and vanilla js flavors.

Package Exports

  • @gravityforms/components
  • @gravityforms/components/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@gravityforms/components) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Gravity Forms Components

The Gravity Forms component library, for both HTML and React components. This is used for our UI's in both the WordPress admin and the front end.

The HTML components are built as plain es6 classes which also export a template function when you don't need a stateful instance.

The React components are standard hooks based functional components using React 18. They depend on our own Libraries package, which - if being used in the WordPress environment with Gravity Forms active - can be enqueued from that plugin for the production bundle.

Installation

Install the module

npm install @gravityforms/components

Usage

You do not need to use this package to utilize our components when building UI's that extend Gravity Forms. You can simply enqueue our css and js files in the WordPress admin and use them from there. Tutorials on how to do that are being added soon.

This package is delivered as es6 modules and pure React, you probably want your webpack or other bundling system to run it through babel with @babel/preset-react active.

In the case of webpack and babel, this means adding it to your exclude property of the rules array in the module object, like so:

const config = {
    // other config
    module: {
        rules: [
            {
                test   : /\.js$/,
                exclude: [ /node_modules\/(?!(@gravityforms)\/).*/ ],
                use    : [
                    {
                        loader: 'babel-loader',
                    },
                ],
            }
        ],
    },
}

Documentation

The documentation for this package is available at http://docs.js.gravity.com/