2.1.1 • Published 1 year ago

@pijma/select v2.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@pijma/select

Select component

Installation

yarn add @pijma/select

npm i @pijma/select

Usage

import { useState } from 'react'
import { Select, SelectStylesB2cFactory } from '@pijma/select'
import { ThemeProvider } from '@pijma/theme-provider'
import { light } from '@pijma/theme-b2c'

const App = () => {
      const options = [
        { text: "First", value: {id: 1} },
        { text: "Second", value: {id: 2} },
        { text: "Third", value: {id: 3} },
        { text: "Fourth", value: {id: 4} },
        { text: "Fifth", value: {id: 5} },
        { text: "six", value: {id: 6} },
        { text: "Seven", value: {id: 7} },
        { text: "Eight", value: {id: 8} },
        { text: "Nine", value: {id: 9} },
        { text: "Ten", value: {id: 10} },
      ]
      const [value, setValue] = useState<SelectOption[]>([])
          const handleChange = (option: React.SetStateAction<SelectOption | undefined>) => {
        setValue(option)
      }
  return (<ThemeProvider theme={light} components={{Select: SelectStylesB2cFactory}}>
    <Select
        options={options}
        value={value}
        onChange={handleChange}
        title={'select'}
    />
</ThemeProvider>}
)

multiple

import { useState } from 'react'
import { Select, SelectStylesB2cFactory } from '@pijma/select'
import { ThemeProvider } from '@pijma/theme-provider'
import { light } from '@pijma/theme-b2c'

const App = () => {
      const options = [
        { text: "First", value: {id: 1} },
        { text: "Second", value: {id: 2} },
        { text: "Third", value: {id: 3} },
        { text: "Fourth", value: {id: 4} },
        { text: "Fifth", value: {id: 5} },
        { text: "six", value: {id: 6} },
        { text: "Seven", value: {id: 7} },
        { text: "Eight", value: {id: 8} },
        { text: "Nine", value: {id: 9} },
        { text: "Ten", value: {id: 10} },
      ]
      const [value, setValue] = useState<SelectOption[]>([])
          const handleChange = (option: React.SetStateAction<SelectOption | undefined>) => {
        setValue(option)
      }
  return (<ThemeProvider theme={light} components={{Select: SelectStylesB2cFactory}}>
    <Select
        multiple
        options={options}
        value={value}
        onChange={handleChange}
        title={'select'}
    />
</ThemeProvider>}
)

See more on Storybook

2.0.15

1 year ago

2.1.1

1 year ago

2.0.16

1 year ago

2.0.13

1 year ago

2.0.14

1 year ago

2.0.12

1 year ago

2.1.0

1 year ago

2.0.17

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.11

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.9

1 year ago

2.0.10

1 year ago

2.0.8

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.4.2

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago