1.2.0 • Published 3 years ago

react-form-elem v1.2.0

Weekly downloads
34
License
MIT
Repository
github
Last release
3 years ago

react-form-elem

Simple dynamic Select and Input elements for react

NPM JavaScript Style Guide

Install

npm install --save react-form-elem

Usage

import React, { useState } from 'react'

import { Select, Input } from 'react-form-elem'

const listOptions = [
  { label: 'Item 1', value: 'item-1' },
  { label: 'Item 2', value: 'item-2' },
  { label: 'Item 3', value: 'item-3' }
]

const SelectTemplate = () => {
  const [value, setValue] = useState(listOptions[0])
  return (
    <Select
      value={value}
      options={listOptions}
      placeholder='Select option'
      onChange={(option) => {
        setValue(option)
      }}
    />
  )
}

const Index = () => {
  return (
    <div>
      <h3>Select</h3>
      <div>
        <SelectTemplate />
      </div>
      <br />
      <br />
      <h3>Input Email</h3>
      <div>
        <Input placeholder='please enter email' />
      </div> <br />
      <h3>Input Number</h3>
      <div>
        <Input type='number' placeholder='you can only input numbers' />
      </div>
    </div>
  )
}

License

MIT © ItsBhatt

1.2.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago