Shards React
Shards React

Shards React

Documentation

Form

Examples and usage guidelines for form controls.

Basic Example

Forms can be created using the Form component.

import React from "react";
import { Form, FormInput, FormGroup } from "shards-react";

export default function FormExample() {
  return (
    <Form>
      <FormGroup>
        <label htmlFor="#username">Username</label>
        <FormInput id="#username" placeholder="Username" />
      </FormGroup>
      <FormGroup>
        <label htmlFor="#password">Password</label>
        <FormInput type="password" id="#password" placeholder="Password" />
      </FormGroup>
    </Form>
  );
}

Props

The following props are available for the Form component.

PropDescriptionTypeDefaultRequired
classNameThe class name.String-No
inlineWhether it is inline, or not.Bool-No
childrenThe children nodes.Array[Node]Node-No
innerRefThe inner ref.ObjectFuncString-No
tagThe component's tag type.FuncString"form"No

Subcomponents

The following subcomponents are available for the Form component.

<FormFeedback/>

PropDescriptionTypeDefaultRequired
childrenThe children.Node-No
tagThe tag type.String"div"No
classNameThe class name.String-No
validWhether the feedback is valid, or not.BoolundefinedNo
tooltipWhether the feedback should be displayed as tooltip.Bool-No