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

@blackbox-vision/rff-material-ui

v0.3.4

Published

RFF UI Wrapper for Material UI

Downloads

18

Readme

RFF Material UI

Material UI Wrapper for React Final Form

Table of contents

Use Case

You're working with react-final-form on web and you need bindings between material-ui and react-final-form.

Compatibility

Since this package uses hooks under the hood, you need at least a minimum React version of 16.8.0.

Installation

YARN

yarn add @blackbox-vision/rff-material-ui

NPM

npm install --save @blackbox-vision/rff-material-ui

Example Usage

After reading and performing the previous steps, you should be able to import the library and use it like in this example:

import React from 'react';
import { Form, Field } from 'react-final-form';
import { TextInput } from '@blackbox-vision/rff-material-ui';

const onSubmit = async (values: any) => alert(JSON.stringify(values, null, 2));

const MyForm = (props: any) => (
  <Form
    onSubmit={onSubmit}
    render={({ handleSubmit }) => (
      <form onSubmit={handleSubmit}>
        <Field
          {...args}
          name="email"
          variant="filled"
          component={TextInput}
          validate={value => (value ? undefined : 'Required')}
        />
        <button type="submit">Send</button>
      </form>
    )}
  />
);

MyForm.displayName = 'MyForm';

export default MyForm;

Storybook

You can run a playground to test components locally. To do this, run the npm run storybook command. Once Storybook server is started, open a browser tab and go to http://localhost:6006/ to start.

Component APIs

TextInput

The TextInput component has the following props:

| Properties | Types | Default Value | Required | Description | | ---------- | ------ | ------------- | -------- | ------------------------------------------------------- | | name | string | - | Yes | Property that represents the name of input | | label | string | - | No | Property that represents the label to show | | classes | object | - | No | Override or extend the styles applied to the component. | | variant | string | "standard" | No | Property that represents the variant of text input |

The TextInput also inherits its own props from material-ui.

Select

The Select component has the following props:

| Properties | Types | Default Value | Required | Description | | ---------- | ------ | ------------- | -------- | -------------------------------------------------- | | name | string | - | Yes | Property that represents the name of input | | label | string | - | No | Property that represents the label to show | | variant | string | "standard" | No | Property that represents the variant of text input | | options | array | - | Yes | Property that represents the options to choose |

The Select also inherits its own props from material-ui.

Checkbox

The Checkbox component has the following props:

| Properties | Types | Default Value | Required | Description | | ---------- | ------ | ------------- | -------- | ------------------------------------------------------- | | name | string | - | Yes | Property that represents the name of input | | label | string | - | No | Property that represents the label to show | | classes | object | - | No | Override or extend the styles applied to the component. | | icon | node | "standard" | No | The icon to display when the component is unchecked. |

The Checkbox also inherits its own props from material-ui.

RadioGroup

The RadioGroup component has the following props:

| Properties | Types | Default Value | Required | Description | | ---------- | ------ | ------------- | -------- | ----------------------------------------------------------- | | name | string | - | Yes | Property that represents the name of input | | label | string | - | No | Property that represents the label to show | | options | array | [] | No | Property that represents the options of radio buttons group |

The RadioGroup also inherits its own props from material-ui.

DatePicker

The DatePicker component has the following props:

| Properties | Types | Default Value | Required | Description | | ---------- | ------ | ------------- | -------- | ------------------------------------------ | | name | string | - | Yes | Property that represents the name of input | | label | string | - | No | Property that represents the label to show |

The DatePicker also inherits its own props from material-ui-pickers.

Issues

Please, open an issue following one of the issues templates. We will do our best to fix them.

Contributing

If you want to contribute to this project see contributing for more information.

License

Distributed under the MIT license. See LICENSE for more information.