0.2.2 • Published 2 days ago

@rhc-shared-components/form-multi-select-component v0.2.2

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 days ago

@rhc-shared-components/sample-project

project description

NPM JavaScript Style Guide

Install

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

Usage

import React from 'react';

import { FormMultiSelectInput } from '@rhc-shared-components/form-multi-select-component';
import { IMultiSelectItem } from '../../dist/FormMultiSelect';
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: IMultiSelectItem[] = options.map((item) => ({
      value: item
    }));
    return getAllOptions;
  };

  return (
    <Formik
      initialValues={{
        [FieldName]: 'test'
      }}
      enableReinitialize={true}
      onSubmit={() => {}}
    >
      <Form>
        <FormMultiSelectInput
          name={FieldName}
          maxHeight={200}
          label='Industries'
          placeholder='Select'
          helperText='Select upto 3 industries'
          selectOptions={getActions()}
          isRequired
          maxItems={3}
        />
      </Form>
    </Formik>
  );
};

export default App;

License

MIT © authorGithubUsername

0.2.2

2 days ago

0.2.1

7 days ago

0.2.0

15 days ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.3

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.3

2 years ago

0.0.5

1 year ago

0.0.4

2 years ago

0.0.6

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago