Textarea

Simple textarea component

Usage

<>
  <Textarea labelText="Textarea label" placeholder="Placeholder" />
</>

Source

import cn from "classnames";

export default function InputText({
  id,
  value,
  onChange,
  className,
  placeholder,
  labelText,
  labelClassName,
  containerClassName,
}) {
  const container = cn(containerClassName);
  const label = cn({ "d_b": true, }, labelClassName);
  const input = cn({ "d_b w_100% bd_black bdrs_xs p_md rsz_v": true, }, className);

  return (
    <div className={container}>
      {labelText && (
        <label htmlFor={id} className={label}>
          {labelText}
        </label>
      )}

      <textarea
        id={id}
        value={value}
        onChange={onChange}
        className={input}
        placeholder={placeholder}
      />
    </div>
  );
}

Source

<div>
  <label class="d_b" for="id">Label</label>
  <textarea
    id="id"
    name="textarea"
    type="text"
    placeholder="Textareea placeholder"
    class="d_b w_100% bd_black bdrs_xs p_md rsz_v"
  ></textarea>
</div>