Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@huner2/react-column-select
Advanced tools
This package is a fork of react-multiselect-two-sides with a few changes.
This package is a typescript conversion, thus types are exported and visible in bundles.
Peer-dependencies have been updated to use recent versions of React.
Tests have been rewritten using modern testing frameworks.
The API is a little bit stricter due to the new Typescript types.
npm install @huner2/react-column-select
import React from 'react';
import createRoot from 'react-dom/client'
import ColumnSelect from '@huner2/react-column-select'
const App = () => {
const options = [
{name: 'Foo', value: 0},
{name: 'Bar', value: 1},
{name: 'Baz', value: 2, disabled: true},
{name: 'Qux', value: 3},
{name: 'Quux', value: 4},
{name: 'Corge', value: 5},
{name: 'Grault', value: 6},
{name: 'Garply', value: 7},
{name: 'Waldo', value: 8},
{name: 'Fred', value: 9},
{name: 'Plugh', value: 10},
{name: 'Xyzzy', value: 11},
{name: 'Thud', value: 12}
]
const [value, setValue] = React.useState([0, 3, 9]);
return (
<ColumnSelect
className="msts_theme_example"
availableHeader="Available"
availableFooter={`Available ${options.length - value.length}`}
selectedHeader="Selected"
selectedFooter={`Selected ${value.length}`}
showControls
searchable
onChange={v => setValue(v)}
/>
);
}
const root = createRoot(document.getElementById("root"));
root.render(App);
Note: all props are optional
but operation would be limited if you did not supply options or a value.
React.ReactNode
Used to provide a custom footer for the available column.
React.ReactNode
Used to provide a custom header for the available column.
string
Used to provide a custom classname to the container component.
string
Used to provide a custom label for the filter clear button.
boolean
Used to toggle the clear button for the filter.
string
Used to provide a custom label for the deselect all button.
boolean
Used to determine whether the value can be changed (readonly).
Value := string | number
Option := {
name := string
value := Value
disabled? := boolean
highlight? := boolean
}
filterBy := (option: Option, filter: string) => boolean
Used to provide a custom filter function. The provided function should accept an option
object and a string
filter and return a boolean
.
The return value determines whether or not the option will be included in the results (i.e. true will show the option).
FilterProps := {
clearFilterText := string
clearable := boolean
disabled := boolean
onChange := (filter: string) => void
placeholder := string
value := string
}
filterComponent := {
React.FunctionComponent<FilterProps> |
React.ComponentClass<FilterProps>
}
Used to provide a custom filter component.
The component should accept an object that conforms to FilterProps
. Whenever the value changes, onChange should be called to propagate back to the ColumnSelect component.
The component can be either a functional component or a class component.
Value := string | number
hightlight := Value[]
Used to provide a list of values that should be highlighted, regardless of column.
number
Limit controls the allowed number of selected items.
Value := string | number
onChange := (options: Value[]) => void
onChange is called with the new array of selected values on any change.
Value := string | number
Option := {
name := string
value := Value
disabled? := boolean
highlight? := boolean
}
Options := Option[]
Options is the list of options that should be available. Name is the label that will be displayed in the columns. Disabled and highlight are both optional and can be enabled per-option to disable or highlight an option.
string
Used to customize the placeholder string in the filter inputs.
boolean
Used to toggle filters on or off.
string
Used to customize the label for the select all button.
React.ReactNode
Used to customize the footer on the selected column.
React.ReactNode
Used to customize the header on the selected column.
boolean
Used to toggle control buttons on or off.
Value := string | number
value := Value[]
Used to specify what options are selected
FAQs
React multiselect with twocolumns
The npm package @huner2/react-column-select receives a total of 5 weekly downloads. As such, @huner2/react-column-select popularity was classified as not popular.
We found that @huner2/react-column-select demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.