@krelsis/react-floating-label-textarea
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

react-floating-label-textarea

License Downloads minified size minzipped size

npm badge

Forked from cymen/react-floating-label-textarea

This fork was created as the original NPM package seems to be broken and is no longer being maintained, an issue was raised regarding the problem, but it has yet to be looked at.

Typescript support

Typescript definitions have been included for convenience.

Original Description

A floating label component for React. It inherits the font-size from the parent.

react-floating-label-textarea

Try it yourself at the Storybook.

Example

import React from 'react';
import FloatingLabelTextarea from 'react-floating-label-textarea';

export default ({ onChange, value }) =>
  <div style={{ fontSize: 64 }}>
    <FloatingLabelTextarea
      id="example-3"
      label="label"
      onBlur={action('onBlur')}
      onChange={action('onChange')}
      onFocus={action('onFocus')}
      value={value}
    />
  </div>;

Props

name optional default
className yes
fontSize yes inherit
id no
label no
onBlur yes
onChange no
onFocus yes
placeholder yes ''
refs yes
type yes text
value yes ''
  • refs is set as ref prop on textarea

Dependencies

Peer dependencies:

  • react
  • styled-components

License

MIT

Package Sidebar

Install

npm i @krelsis/react-floating-label-textarea

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

16.2 kB

Total Files

7

Last publish

Collaborators

  • krelsis