0.1.4 • Published 6 months ago

@rhc-shared-components/form-select-component v0.1.4

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
6 months ago

@rhc-shared-components/sample-project

project description

NPM JavaScript Style Guide

Install

npm install --save @rhc-shared-components/form-select-component

Usage

import React from 'react';

import {
  FormSelect,
  ISelectItem
} from '@rhc-shared-components/form-select-component';
import { Form, Formik } from 'formik';

const App = () => {
  const FieldName = 'form multi select';
  const options = [
    'Accounting',
    'API Management',
    'Application Delivery',
    'Application Server',
    'Automation',
    'Backup & Recovery',
    'Business Intelligence',
    'Business Process Management',
    'Capacity Management'
  ];
  const getActions = () => {
    const getAllOptions: ISelectItem[] = options.map((item) => ({
      value: item
    }));
    return getAllOptions;
  };

  return (
    <Formik
      initialValues={{
        [FieldName]: 'test'
      }}
      enableReinitialize={true}
      onSubmit={() => {}}
    >
      <Form>
        <FormSelect
          name={FieldName}
          label='Types of business'
          placeholder='Select'
          selectOptions={getActions()}
          isRequired
        />
      </Form>
    </Formik>
  );
};

export default App;

License

MIT © authorGithubUsername

0.1.4

6 months ago

0.1.3

9 months ago

0.1.2

1 year ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago