Skip to content

Instantly share code, notes, and snippets.

@adamklingbaum
Last active November 15, 2021 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamklingbaum/a91c16e8cfca406baeab86d0ecdf3194 to your computer and use it in GitHub Desktop.
Save adamklingbaum/a91c16e8cfca406baeab86d0ecdf3194 to your computer and use it in GitHub Desktop.
import React, { useState, useCallback } from 'react';
import { Container, Form, Button } from 'react-bootstrap';
export default function ValidatedForm() {
return (
<Container>
<h1>Sign up</h1>
<Form>
...
<Form.Group className="mb-3" controlId="email">
<Form.Label>Email address</Form.Label>
<Form.Control
type="email"
name="email"
placeholder="Enter your email address"
/>
</Form.Group>
<Form.Group className="mb-3" controlId="password">
<Form.Label>Password</Form.Label>
<Form.Control type="password" name="password" />
</Form.Group>
<Form.Group className="mb-3" controlId="confirm-password">
<Form.Label>Confirm password</Form.Label>
<Form.Control type="password" name="confirmPassword" />
</Form.Group>
<Form.Group className="mb-3" controlId="type">
<Form.Label>Account type</Form.Label>
{['personal', 'business', 'enterprise'].map((option) => (
<div key={option} className="mb-3">
<Form.Check
type="radio"
id={`type-${option}`}
name="type"
value={option}
label={option.charAt(0).toUpperCase(0) + option.substring(1)}
/>
</div>
))}
</Form.Group>
<Form.Group className="mb-3" controlId="bio">
<Form.Label>Tell us a bit about yourself</Form.Label>
<Form.Control as="textarea" name="bio" rows={3} />
</Form.Group>
...
</Form>
</Container>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment