@rhc-shared-components/form-select-component
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @rhc-shared-components/form-select-component

Weekly Downloads

4

Version

0.1.4

License

MIT

Unpacked Size

987 kB

Total Files

10

Last publish

Collaborators

  • eyevana
  • kipatil-1
  • shkale
  • bdone
  • gkr-redhat