1.0.0-rc.1 • Published 1 year ago

@seragam-ui/selection-box v1.0.0-rc.1

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

@seragam-ui/selection-box

A customizable selection box component that behaves like a radio button with the ability to adjust its style.

Installation

yarn add @seragam-ui/selection-box
# or
npm i @seragam-ui/selection-box

Usage

import * as React from 'react'
import { SelectionBox, SelectionBoxOption } from '@seragam-ui/selection-box'

const MyAwesomeApp = () => {
  const [selected, setSelected] = React.useState(DATA[0])

  return (
    <SelectionBox name="example" value={selected} onChange={setSelected}>
      {DATA.map((item) => (
        <SelectionBoxOption key={item.name} value={item}>
          {item.name}
        </SelectionBoxOption>
      ))}
    </SelectionBox>
  )
}