JSPM

@gdo-bzh/textarea-autosize

1.0.0-rc.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q46354F
  • License MIT

Package Exports

  • @gdo-bzh/textarea-autosize

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@gdo-bzh/textarea-autosize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

version

textarea-autosize

NPM JavaScript Style Guide

A textarea component which automatically adjust its height on keyboard and window resize events

Install

yarn add @gdo-bzh/textarea-autosize react

Usage

import React from 'react'

const Example: React.FC = () =>  (<TextareaAutosize autofocus autoselect placeholder="type text" />)

Types

type Props = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'rows'> & State

type State = {
  /**
   * true to autoselect text content at initialize
   */
  autoselect?: boolean;
  /**
   * the value of an <textarea> element
   */
  value?: React.TextareaHTMLAttributes<HTMLTextAreaElement>['value'];
  /**
   * Minimum number of rows to display. Default value is 1
   */
  minRows?: number;
  /**
   * Maximum number of rows to display.
   */
  maxRows?: number;
}

License

MIT © gdo-bzh