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

avi-form

v1.0.34

Published

Light package for creating styled forms using mui and react-form-hook

Downloads

61

Readme

AviForm

npm license

AviForm is a flexible and easy-to-use form component built on top of React, Material-UI and react-form-hook. It simplifies the process of creating different types of input fields by providing a single interface.

Table of Contents

Installation

Install using npm:

npm install avi-form --save

Or With yarn:

yarn add avi-form

Usage

Basic Usage

To start using AviForm:

import { AviForm, useAviForm, create } from 'avi-form';
const { formProps } = useAviForm(config);
<AviForm formProps={formProps} />;

Examples

const { formProps } = useAviForm({
  fields: [
    createHeader({ label: 'Personal Information' }),
    createTextField({
      label: 'Vorname',
      name: 'firstName',
      getValue: (value) => value.lastName.length === 0 && { disabled: true },
    }),
    createTextField({
      label: 'Nachname',
      name: 'lastName',
      onValueChange(setValue, value) {
        if (value === 'Form') {
          setValue('firstName', 'Avi');
        }
      },
    }),
    createAutocomplete({
      name: 'country',
      label: 'Country',
      options: ['USA', 'UK', 'Canada'],
    }),
    createDatePicker({ name: 'birthdate', label: 'Birth Date' }),
    createButton({ label: 'Submit' }),
  ],
  onSubmit: (data) => console.log(data),
});

return <AviForm formProps={formProps} />;

FAQ

Q: How do I use AviForm in my project? A: Simply install the avi-form package via npm or yarn, then use the useAviForm hook to generate form properties and pass them to the AviForm component.

Q: What versions of React does AviForm support? A: AviForm supports React 18 and above. If you encounter any issues with older versions of React, consider upgrading or open an issue in the GitHub repository.

Q: Are there any plans to support other UI libraries in the future? A: As of now, AviForm is primarily built for Material-UI. However, contributions are always welcome to expand its compatibility with other libraries.

Contributing

We welcome contributions to AviForm, but we do maintain some strict guidelines to ensure the quality and consistency of the codebase. Please read and adhere to the following before submitting a pull request:

  1. Fork and Clone the Repository: Start by forking the repository and then clone your fork to your local machine.

  2. Create a Feature Branch: Always create a new branch for your changes. Avoid working directly on the main branch.

  3. Follow Coding Standards: Ensure that your code follows the existing coding conventions and standards used throughout the project.

  4. Update Documentation: Update the README or other documentation to reflect any changes or additions you have made.

  5. Submit a Pull Request: Create a pull request from your fork to the original repository. Provide a detailed description of your changes and reference any related issues.

  6. Respond to Feedback: Be prepared to address feedback on your pull request. Changes may be requested before your pull request is accepted.

  7. No Direct Commits to main: Direct commits to the main branch are strictly prohibited. All changes must come through pull requests.

By following these guidelines, you help ensure that AviForm remains a high-quality, maintainable project. If you have any questions about the contribution process, please open an issue or reach out to a maintainer.

Thank you for your interest in contributing to AviForm!

License

AviForm is MIT licensed.

AviForm