Shards React
Shards React

Shards React

Documentation

Form Textarea

The FormTextarea component allows you to easily create multi-line text inputs.

Basic Example

🤔 Waiting for you to say something...

import React from "react";
import { FormTextarea } from "shards-react";

export default class BasicFormTextarea extends React.Component {
  constructor(props) {
    super(props);
    this.handleChange = this.handleChange.bind(this);
    this.state = { value: null };
  }

  handleChange(e) {
    this.setState({ value: e.target.value });
  }

  render() {
    const { value } = this.state;
    return (
      <div>
        <p className="mb-2">
          {(value && `🗣 ${value}`) || "🤔 Waiting for you to say something..."}
        </p>
        <FormTextarea onChange={this.handleChange} />
      </div>
    );
  }
}

Props

The following props are available for the Form Textarea component.

PropDescriptionTypeDefaultRequired
classNameThe class name.String-No
childrenThe children nodes.Node-No
sizeThe size.String-No
plaintextWhether it should be displayed as plain text, or not.Bool-No
validWhether it is valid, or not.Bool-No
invalidWhether it is invalid, or not.Bool-No
innerRefThe inner ref.ObjectFuncString-No