npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ddkits-react-form

v1.0.11

Published

DDKits React dynamic form, powered by www.reallexi.com, is a custom fully component to build a dynamic fully functional form, with required, pagination and fields validation, all in one. Easy use by JSON or an object to pass. free of bugs.

Downloads

8

Readme

ddkits-react-form

DDKits React Form is a custom fully component to build a dynamic. Fully functional form, with required, pagination and fields validation, all in one. Easy use by JSON or an object to pass. Conditional and progressive pages and fields, show if needed or hide if another value doesn't equal to another value. Nice spinner between pages in loading

DDKits Form Example 1 DDKits Form Example 2 DDKits Form Example 3

Funding

https://opencollective.com/reallexi

Get started

npm i -s ddkits-react-form

Options to use

1- Any HTML 5 type 2- Any name of field, fields names must be unique as each one of them is the main value update 3- Page / Field group / Option components 4- Label 5- Required if the field is required 6- Conditional Case for a page or field to show depends on another field or page values

Example:

{
    component: "page",
    label: "General",
    fields: [
    {
        component: "text",
        name: 'firstname',
        label: "First Name",
        type: "text",
        required: true,
    },
    {
        component: "text",
        name: 'lastname',
        label: "Last Name",
        type: "text",
        required: true,
    }
 }

Conditional Example

 {
          component: "page",
          label: "If the first name is === sam this page will show",
           conditional: {
             value: "Sam",
             field:
               "first_name"
           },
          fields: [
            {
                component: "text",
                type: 'text',
                name: 'howdidyoufindus',
                label: 'How did you hear about us? ex. Google, Yahoo, Joe D., client, ...',
                required: true,
            },
            {
                component: "text",
                type: 'textarea',
                name: 'message',
                label: 'Tell us about Google experience',
                required: false,
                 conditional: {
                    value: "Google",
                    field:
                    "howdidyoufindus"
                },
            }
          ]
        },

Example of usage

import './App.css';
import { Form } from 'ddkits-react-form'
import { useCallback, useState } from 'react';

function App() {
  const [message, setmessage] = useState('')
  const thisActionCallback = useCallback(
    
    async (values) => {
      console.log(values)
      setmessage('Submitted Successfuly. Data in console..')
    }
  )
  const formData = [
      {
        component: "page",
        label: "General",
        fields: [
          {
              component: "text",
              name: 'firstname',
              label: "First Name",
              type: "text",
              required: true,
          },
          {
              component: "text",
              name: 'lastname',
              label: "Last Name",
              type: "text",
              required: true,
          },
          {
            component: "text",
            name: 'email',
            label: "Email",
            type: "email",
            required: true,
          },
          {
            component: "text",
            name: 'phone',
            label: "Phone",
            type: "text",
            required: true,
          }
        ]
      },
      {
        component: "page",
        label: "Location - Address",
        fields: [
          {
              component: "text",
              type: 'text',
              name: 'zipcode',
              label: 'Zip-code',
              required: true,
          },
          {
              component: "text",
              type: 'text',
              name: 'state',
              label: 'State',
              required: true,
          },
          {
              component: "text",
              type: 'text',
              name: 'address',
              label: 'Address, ex. xxxx street',
              required: true,
          },
          {
              component: "text",
              type: 'text',
              name: 'apt',
              label: 'Apartment # ex. 1234',
              required: false,
          }
        ]
      },
      {
        component: "page",
        label: "How can we help!",
      //   conditional: {
      //     value: "one",
      //     field:
      //       "first_name"
      //   },
        fields: [
          {
              component: "text",
              type: 'text',
              name: 'howdidyoufindus',
              label: 'How did you hear about us? ex. Google, Yahoo, Joe D., client, ...',
              required: false,
          },
          {
              component: "text",
              type: 'textarea',
              name: 'message',
              label: 'Tell us more about the project',
              required: false,
          }
        ]
      },
      {
        component: "page",
        label: "Final Comment",
        fields: [
          {
            component: "text",
            name: 'comment',
            type: "textarea",
            required: false,
          }
        ]
      }
    ];
  return (
    <div className="App">
      <header className="App-header">
      {message !== '' ? <div className="alert alert-success alert-dismissible dismissible">{message}</div>
        : <Form formData={formData} thisAction={thisActionCallback} btntext={'Testing DDKits'} />}
      </header>
    </div>
  );
}

export default App;

Powered By: www.reallexi.com ReaLexi | The Real Word