Open In App

React Rebass Forms Complete Reference

Last Updated : 05 Apr, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

React Rebass is a front-end framework that was designed keeping react in mind. Accessible and themeable form components for use with Rebass. Forms are generally used when you want to collect data from the user.

For example, a user wants to buy a bag online, so he/she has to first enter their shipping address in the address form and then add their payment detail in the payment form to place an order.

Javascript




import React from "react";
import { Label, Input } from "@rebass/forms";
  
function App() {
  return (
    <div style={{ display: "block", width: 500, padding: "100px" }}>
      <box>
        <Label htmlFor="name">Name</Label>
        <Input id="name" name="name" type="text" defaultValue="john" />
        <Label htmlFor="email">Email Id</Label>
        <Input
          id="email"
          name="email"
          type="email"
          defaultValue="john@example.com"
        />
        <Label htmlFor="password">Password</Label>
        <Input id="password" name="password" type="password" />
      </box>
    </div>
  );
}
  
export default App;


Output:
Sample code output of React Rebass


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

Similar Reads