Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-column-select

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-column-select

React component to select options by transferring them from one column to another.

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Column Select

NPM CI react-column-select DeepScan grade SIZE Depfu GitHub

Example

🚀 Features

  • Easily customize colors
  • Responsive Design
  • Styled with emotion
  • Built with Typescript

⚡ Installation

yarn add react-column-select
# or
npm i react-column-select

🏁 Getting Started

import React, { useState } from 'react'
import ColumnSelect from 'react-column-select'

const hobbies = [
  { value: '1', label: 'Hockey' },
  { value: '2', label: 'Painting' },
  { value: '3', label: 'Singing' },
]

const HobbiesSelect = () => {
  const [selected, setSelected] = useState([])

  const onChange = (values) => {
    setSelected(values)
  }

  return (
    <div>
      <h2>Select Your Hobbies</h2>
      <ColumnSelect
        options={hobbies}
        onChange={onChange}
        labels={{
          leftHeader: 'Available Hobbies',
          rightHeader: 'Selected Hobbies',
        }}
      />
    </div>
  )
}

⚙️ Props

nametypeisRequireddefaultdescription
optionsarrayN/Aavailable select options
onChangefunctionN/Afunction called when selected values change
defaultValuearray[]set the initial selected values
maxnumberN/Aset the max number of options that can be selected
labelsobjectsee belowthe labels for the headers, buttons & search input
themeobjectsee belowthe color theme
isSearchablebooleanfalseenables searching
disableAllButtonsbooleanfalsedisable the "Add All" and "Remove All" buttons
disableDoubleClickbooleanfalsedisable double click to add/remove an option
disableKeyboardbooleanfalsedisable navigation the select options with keyboard

🎨 Theme Customization

Below is the default theme. Change the values that you want to customize:

{
    headerBgColor: '#d1d5db',
    columnBorderColor: '#9ca3af',
    textColor: '#000000',
    columnBgColor: '#CBD5E0',
    buttonBgColor: '#CBD5E0',
    optionSelectedBgColor: '#EDF2F7',
    optionHoverBgColor: '#FAFBFC',
    searchFocusBorderColor: '#06b6d4',
}

🏷️ Label Customization

Below are the default labels. Change the values that you want to customize:

{
    leftHeader: 'Options',
    rightHeader: 'Selected',
    searchPlaceholder: 'Search ...',
    add: 'Add',
    addAll: 'Add All',
    remove: 'Remove',
    removeAll: 'Remove All',
}

License

Distributed under the MIT license. See LICENSE for more information.

Keywords

FAQs

Package last updated on 30 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc