Open In App

React Suite Container Login Page Layout

Last Updated : 26 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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 Container Login Page Layout. The container layout can define the main frame of the page using header, content, sidebar, and footer components. In a container, we can add Form components to create a Login page layout using form input fields, and buttons.

Syntax:

<Container>
    <Header>Header</Header>
     <Navbar>...</Navbar>
    <Content>
        <Form>
            ...
        </Form>
    </Content>
    <Footer>Footer</Footer>
</Container>

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 login page container with a fluid size layout.

Javascript




import {
    Container,
    Header,
    Content,
    Nav,
    Navbar,
    FlexboxGrid,
    Panel,
    Form,
    ButtonToolbar,
    Button,
    Footer,
} from "rsuite";
import "rsuite/dist/rsuite.min.css";
  
export default function App() {
    return (
        <div>
            <Container>
                <Header>
                    <Navbar appearance="inverse" 
                        style={{ backgroundColor: "green" }}>
                        <Navbar.Brand>GeeksforGeeks</Navbar.Brand>
                        <Nav>
                            <Nav.Item>Home</Nav.Item>
                            <Nav.Item>About</Nav.Item>
                            <Nav.Item>Practice</Nav.Item>
                            <Nav.Menu title="Tutorials">
                                <Nav.Item>Data Structures</Nav.Item>
                                <Nav.Item>Algorithms</Nav.Item>
                                <Nav.Item>Web Development</Nav.Item>
                            </Nav.Menu>
                        </Nav>
                        <Nav pullRight>
                            <Nav.Item>Contact</Nav.Item>
                        </Nav>
                    </Navbar>
                </Header>
  
                <div style={{ textAlign: "center" }}>
                    <h2>GeeksforGeeks</h2>
                    <h4 style={{ color: "green" }}>
                        React Suite Container Login Page Layout
                    </h4>
                </div>
                  
                <Content>
                    <FlexboxGrid justify="center" style={{ margin: 20 }}>
                        <FlexboxGrid.Item colspan={12}>
                            <Panel header={<h3>Login</h3>} bordered>
                                <Form fluid>
                                    <Form.Group>
                                        <Form.ControlLabel>
                                            Email
                                        </Form.ControlLabel>
                                        <Form.Control name="email" 
                                            type="email" />
                                    </Form.Group>
                                    <Form.Group>
                                        <Form.ControlLabel>
                                            Password
                                        </Form.ControlLabel>
                                        <Form.Control name="password" 
                                            type="password" />
                                    </Form.Group>
                                    <Form.Group>
                                        <ButtonToolbar>
                                            <Button appearance="primary" 
                                                color="green">
                                                Sign in
                                            </Button>
                                            <Button appearance="link">
                                                Forgot password?
                                            </Button>
                                        </ButtonToolbar>
                                    </Form.Group>
                                </Form>
                            </Panel>
                        </FlexboxGrid.Item>
                    </FlexboxGrid>
                </Content>
                <Footer style={{ textAlign: "center", margin: 20 }}>
                    © GeeksforGeeks
                </Footer>
            </Container>
        </div>
    );
}


Output:

 

Example 2: Below example demonstrates the login page container layout with a help text button.

Javascript




import {
    Container,
    Header,
    Content,
    Nav,
    Navbar,
    FlexboxGrid,
    Panel,
    Form,
    ButtonToolbar,
    Button,
    Footer,
} from "rsuite";
import "rsuite/dist/rsuite.min.css";
  
export default function App() {
    return (
        <div>
            <Container>
                <Header>
                    <Navbar appearance="inverse" 
                        style={{ backgroundColor: "green" }}>
                        <Navbar.Brand>GeeksforGeeks</Navbar.Brand>
                        <Nav>
                            <Nav.Item>Home</Nav.Item>
                            <Nav.Item>About</Nav.Item>
                            <Nav.Item>Practice</Nav.Item>
                            <Nav.Menu title="Tutorials">
                                <Nav.Item>Data Structures</Nav.Item>
                                <Nav.Item>Algorithms</Nav.Item>
                                <Nav.Item>Web Development</Nav.Item>
                            </Nav.Menu>
                        </Nav>
                        <Nav pullRight>
                            <Nav.Item>Contact</Nav.Item>
                        </Nav>
                    </Navbar>
                </Header>
                <div style={{ textAlign: "center" }}>
                    <h2>GeeksforGeeks</h2>
                    <h4 style={{ color: "green" }}>
                        React Suite Container Login Page Layout
                    </h4>
                </div>
                <Content>
                    <FlexboxGrid justify="center" 
                        style={{ margin: 20 }}>
                        <FlexboxGrid.Item>
                            <Panel header={<h3>Login</h3>} bordered>
                                <Form>
                                    <Form.Group>
                                        <Form.ControlLabel>
                                            Email
                                        </Form.ControlLabel>
                                        <Form.Control name="email" 
                                            type="email" required />
                                        <Form.HelpText tooltip>
                                            Required
                                        </Form.HelpText>
                                    </Form.Group>
                                    <Form.Group>
                                        <Form.ControlLabel>
                                            Password
                                        </Form.ControlLabel>
                                        <Form.Control name="password"
                                            type="password" />
                                    </Form.Group>
                                    <Form.Group>
                                        <ButtonToolbar>
                                            <Button appearance="primary"
                                                color="green">
                                                Sign in
                                            </Button>
                                            <Button appearance="ghost" 
                                                color="red">Cancel</Button>
                                        </ButtonToolbar>
                                    </Form.Group>
                                </Form>
                            </Panel>
                        </FlexboxGrid.Item>
                    </FlexboxGrid>
                </Content>
                <Footer style={{ textAlign: "center", margin: 20 }}>
                    © GeeksforGeeks
                </Footer>
            </Container>
        </div>
    );
}


Output:

 

Reference: https://rsuitejs.com/components/container/#login-page-layout



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads