Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@lemmon/custom-textarea

0.1.1 • Public • Published

<custom-textarea>

Web Components custom-textarea element.

Reason behind this component is to create a plain unstyled autogrowing textarea.

Demo

Install

npm i @lemmon/custom-textarea

Use Inside Your Web App

// does register the component for you
// with `custom-textarea` tagname
require('@lemmon/custom-textarea')

or

// does not register the component
// useful when you want to extend the component
// or to chose a different tag name
const Textarea = require('@lemmon/custom-textarea/element')
class TextareaUpgraded extends Textarea {}
customElements.define('upgraded-textarea', TextareaUpgraded)

Use With The CDN

<script src="https://unpkg.com/@lemmon/custom-textarea/dist/index.js"></script>

Example

<custom-textarea name="text">Hello World!</custom-textarea>

You can apply your own styles. Fonts, colors, line-height, and padding are inherited. Placeholder styles can be defined using CSS variables.

custom-textarea {
  --placeholder-color: orange; /* default: inherit */
  --placeholder-opacity: 1;    /* default: 0.5 */
}

License

MIT

Install

npm i @lemmon/custom-textarea

DownloadsWeekly Downloads

28

Version

0.1.1

License

MIT

Unpacked Size

9.27 kB

Total Files

6

Last publish

Collaborators

  • avatar