|
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 DatePicker ts:Ranges Prop. The DatePicker Component is used to choose a time or date from the picker. To add multiple custom DatePicker options like label, values, or closeOverlay, we can create an interface using ts:Ranges prop. DatePicker Ranges Props:
Syntax: Function App() { return ( <DatePicker ranges={[ { label: "...", value: addDays(new Date(), -1), closeOverlay: boolean }, { label: "...", value: new Date(), closeOverlay: boolean } ]} /> } 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 ts:Ranges prop of datepicker component. Javascript
Output: ![]()
Example 2: Below example demonstrates the ts:Ranges prop using closeOverlay in a datepicker component. Javascript
Output: ![]()
Note: In the above output, the overlay closes after selecting today as a date. Reference: https://rsuitejs.com/components/date-picker/#code-ts-ranges-code |
Reffered: https://www.geeksforgeeks.org
ReactJS |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 11 |