![]() |
React Suite is a front-end library designed for the middle platform and back-end products. React Suite FlexboxGrid component allows the user to use 24 grids as it is a grid layout component. The FlexboxGrid Responsive can be created by combining with the <Col> component. Note: We are passing Col as props value of FlexboxGrid.Item so that it derived the characters of Col component which takes these props xxl, xl, lg, md, sm, and xs. For responsiveness we pass the following props:
Syntax: <FlexboxGrid> <FlexboxGrid.Item as={Col} xs={ } sm={ } md={ } lg={ } xl={ } xxl={ } > </FlexboxGrid.Item> </FlexboxGrid> Prerequisite:
Creating React Application and Module installation: Step 1: Create the react project folder, for that open the terminal, and write the command npm create-react-app folder name, if you have already installed create-react-app globally. If you haven’t then install create-react-app globally by using the command npm -g create-react-app or can install locally by npm i create-react-app. npm create-react-app project Step 2: After creating your project folder(i.e. project), move to it by using the following command. cd project Step 3: now install the dependency by using the following command: npm install rsuite Project Structure: It will look like this: ![]()
Example 1: We are importing the FlexboxGrid and Col Components from “rsuite”, and to apply the default styles of the components we are importing “rsuite/dist/rsuite.min.css”. We are adding the FlexboxGrid Components, within it, we are adding <FlexboxGrid.Item> with te as a prop as Col Component and we are passing different values to the xs, sm, and md. App.js
Step to Run Application: Run the application using the following command from the project’s root directory. npm start Output: ![]()
Example 2: We are importing the FlexboxGrid and Col Components from “rsuite”, and to apply the default styles of the components we are importing “rsuite/dist/rsuite.min.css”. We are adding two FlexboxGrid Components. Within it, we are adding <FlexboxGrid.Item> with as prop equals to Col Component and we are passing different values to the xs, sm, md, and lg. App.js
Step to Run Application: Run the application using the following command from the project’s root directory. npm start Output: ![]()
Reference: https://rsuitejs.com/components/flexbox-grid/#responsive |
Reffered: https://www.geeksforgeeks.org
ReactJS |
Related |
---|
![]() |
|
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |