Skip to main content

Command Palette

Search for a command to run...

How to use Form in React-Bootstrap ?

Published
1 min read
S

I love learning about technology and sharing that with others

This blog post is more about the example how we can make use of the Form in React in real time.

importing react-bootstrap Form

```import Form from 'react-bootstrap/Form'



simplest example of Form

```code
  <Form>
          <Form.Group className='mb-3' controlId='firstName'>
            <Form.Label>First Name</Form.Label>
            <Form.Control type='text' className="fnameInput"></Form.Control>
          </Form.Group>
</Form

How to change the width of the input using Form.Group ?

For this we need to change the width in the CSS and also add the important in the above Form Control we have a class fnameInput we can apply this in the CSS file

.fnameInput {
  width: 25% !important;
}
5 views

More from this blog

H

hashcodehub

271 posts

Consistent, Passionate and Organized :)