An open API service indexing awesome lists of open source software.

https://github.com/lemmon/custom-textarea

Web Components custom-textarea element.
https://github.com/lemmon/custom-textarea

autogrow custom-elements html textarea web-components

Last synced: 2 months ago
JSON representation

Web Components custom-textarea element.

Awesome Lists containing this project

README

        

# \

Web Components custom-textarea element.

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

[Demo](https://www.lemmonjuice.com/custom-textarea/)

## Install

```sh
npm i @lemmon/custom-textarea
```

or reference directly:

```html

```

### Usage

```js
// does register the component for you
// with `custom-textarea` tagname
import '@lemmon/custom-textarea'
```

or

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

### Use With The CDN

```html
<script type="module" src="https://unpkg.com/@lemmon/custom-textarea">

```

## Example

```html
Hello World!
```

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

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

## License

MIT