Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pascalallen/react-form-components

Repository for the @pascalallen/react-form-components NPM package. Simple HTML form elements for React.
https://github.com/pascalallen/react-form-components

react sass typescript

Last synced: 8 days ago
JSON representation

Repository for the @pascalallen/react-form-components NPM package. Simple HTML form elements for React.

Awesome Lists containing this project

README

        

# React Form Components

Simple HTML form elements for React.

## Installation

Use the package manager [yarn](https://classic.yarnpkg.com/lang/en/docs/install) to install @pascalallen/react-form-components.

```bash
yarn add @pascalallen/react-form-components
```

## Usage

```typescript jsx
import { ChangeEvent, useState } from 'react';
import '@pascalallen/react-form-components/dist/app.scss';
import { Form, InputControl } from '@pascalallen/react-form-components';

const [emailAddress, setEmailAddress] = useState("");

const handleChange = (event: ChangeEvent): void => {
setEmailAddress(event.target.value);
};

0}
required
error={emailAddress.length < 1 && "Email address is required"}
onChange={handleChange}
/>
;
```