React Suite CheckPicker Props
Last Updated :
05 Jul, 2022
React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application.
In this article, we'll learn about React suite <Checkpicker> props. <Checkpicker> component is used to select multiple options or to select a group of data items.
Checkpicker Props:
- appearance: It is used for the component appearance.
- block: It is used to block an entire row.
- classPrefix: It denotes the prefix of the component CSS class.
- cleanable: It indicates whether the option can be emptied or not.
- container: It is used to set the rendering container.
- data: It denotes the selectable data.
- defaultValue: It denotes the default value.
- disabled: It indicates whether the component is disabled or not.
- disabledItemValues: It is used to disable optional.
- groupBy: It is used to set the grouping criteria ‘key’ in ‘data’.
- labelKey: It is used to set the options to display the ‘key’ in ‘data’.
- listProps: It denotes the list-related properties in react-virtualized.
- menuMaxHeight: It is used to set the max height of the Dropdown.
- menuClassName: It denotes a CSS class to apply to the Menu DOM node.
- menuStyle: It denotes a style to apply to the Menu DOM node.
- onChange: It is a callback function that is triggered when the value changes.
- onClean: It is a callback function that is triggered when the value is clean.
- onClose: It is a callback function that is triggered on a close event.
- onEnter: It is a callback function that is triggered before the overlay transitions in.
- onEntered: It is a callback function that is triggered after the overlay finishes transitioning in.
- onEntering: It is a callback function that is triggered as the overlay begins to transition in.
- onExit: It is a callback function that is triggered right before the overlay transitions out.
- onExited: It is a callback function that is triggered after the overlay finishes transitioning out.
- onExiting: It is a callback function that is triggered as the overlay begins to transition out.
- onGroupTitleClick: Click the callback function for the group header.
- onOpen: It is a callback function that is triggered on open of the component.
- onSearch: It is a callback function for the search.
- onSelect: It is a callback function that is triggered on the selection of an option.
- placeholder: It denotes the placeholder.
- placement: It is used for the placement of components.
- preventOverflow: It is used to prevent floating element overflow.
- renderExtraFooter: It is used for the custom render extra footer.
- renderMenu: It is used for customizing the Rendering Menu list.
- renderMenuGroup: It is used for the custom Render Options Group.
- renderMenuItem: It is used for the custom Render Options.
- renderValue: It is used for the custom Render selected options.
- searchBy: It is used for the custom search rules.
- searchable: It indicates whether you can search for options or not.
- size: It denotes the picker size.
- sort: It is used for the sort options.
- sticky: It is used to position the top of the selected option in the options.
- toggleAs: It can be used for the custom element for this component.
- value: It denotes the value (Controlled).
- valueKey: It is used to set the option value ‘key’ in ‘data’.
- virtualized: It indicates whether to use Virtualized List or not.
- caretAs: It adds a Custom component for the caret icon.
Syntax:
import { CheckPicker } from "rsuite";
Function App() {
return (
<CheckPicker value={value} onChange={setValue} data={data} />
);
}
Creating React Application And Installing Module:
Step 1: Create a React application using the given command:
npm create-react-app projectname
Step 2: After creating your project, move to it using the given command:
cd projectname
Step 3: Now Install the rsuite node package using the given command:
npm install rsuite
Project Structure: Now your project structure should look like the following:
Â
Example 1: Below example demonstrates the data, size, appearance, and placeholder checkpicker props.
JavaScript
import "rsuite/dist/rsuite.min.css";
import { CheckPicker } from "rsuite/";
export default function App() {
// Sample courses data
const data = [{
"label": "Sorting",
"value": "Sorting",
},
{
"label": "Searching",
"value": "Searching",
},
{
"label": "Greedy",
"value": "Greedy",
},
{
"label": "Dynamic Programming",
"value": "DP",
},
{
"label": "Backtracking",
"value": "Backtracking",
},
]
return (
<center>
<div>
<h2>GeeksforGeeks</h2>
<h4 style={{ color: "green" }}>
React Suite CheckPicker Props
</h4>
<div style={{ marginTop: 20, width: 800 }}>
<CheckPicker
data={data}
size="lg"
appearance="subtle"
placeholder="Select Algorithms"
/>
</div>
</div>
</center>
);
}
Output:
Â
Example 2: Another example demonstrating the sticky, defaultValue, and disabledOptionValues checkpicker props.
JavaScript
import "rsuite/dist/rsuite.min.css";
import { CheckPicker } from "rsuite/";
export default function App() {
// Sample courses data
const data = [{
"label": "Sorting",
"value": "Sorting",
},
{
"label": "Searching",
"value": "Searching",
},
{
"label": "Greedy",
"value": "Greedy",
},
{
"label": "Dynamic Programming",
"value": "DP",
},
{
"label": "Backtracking",
"value": "Backtracking",
},
]
return (
<center>
<div>
<h2>GeeksforGeeks</h2>
<h4 style={{ color: "green" }}>
React Suite CheckPicker Props
</h4>
<div style={{ marginTop: 20, width: 800 }}>
<CheckPicker
sticky
data={data}
defaultValue={['Greedy', 'Sorting']}
disabledItemValues={['Backtracking']}
placeholder="Select Algorithms"
/>
</div>
</div>
</center>
);
}
Output:
Â
Reference: https://rsuitejs.com/components/check-picker/#code-lt-check-picker-gt-code
Similar Reads
React Suite CheckPicker Props
React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, we'll learn about React suite <Checkpicker
5 min read
React Suite CheckPicker Component
React Suite is a popular front-end library with a set of React components that are designed for the middle platform and back-end products. CheckPicker component allows the user to select multiple data. This component also supports grouping. We can use the following approach in ReactJS to use the Rea
4 min read
React Suite CheckPicker Container and prevent overflow
React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, weâll learn about React suite Checkpicker Contai
5 min read
React Suite CheckPicker Controlled
React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, we'll learn about React suite Checkpicker contro
3 min read
React Suite CheckPicker Async
React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, we'll learn about React suite Checkpicker async.
3 min read
React Suite CheckPicker Extra footer
React Suite is a front-end library designed for the middle platform and back-end products. React Suite CheckPicker component is used as multiple selectors of data. We can also group data using this component. The renderExtraFooter in the React Suite CheckPicker provides a way to add an extra footer
3 min read
React Suite CheckPicker Custom Options
React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, weâll learn about React suite Checkpicker Custom
3 min read
React Suite CheckPicker Appearance
React Suite is a front-end library designed for the middle platform and back-end products. React Suite CheckPicker component is used as multiple selectors of data. We can also group data using this component. The appearance prop defines the way how the CheckPicker will visually appear to the users.
3 min read
React Suite CheckPicker Placement
React Suite is a front-end library designed for the middle platform and back-end products. React Suite CheckPicker component is used as multiple selectors of data. We can also group data using this component. The placement of the React Suite CheckPicker component defines the position of the CheckPic
3 min read
React Suite CheckPicker Group
React suite is a library of React components, sensible UI design, and a friendly development experience. It is supported in all major browsers. It provides pre-built components of React which can be used easily in any web application. In this article, weâll learn about React suite Checkpicker Group.
3 min read