GithubHelp home page GithubHelp logo

lemmon / custom-textarea Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 47 KB

Web Components custom-textarea element.

Home Page: https://www.lemmonjuice.com/custom-textarea/

License: MIT License

JavaScript 33.01% Shell 2.79% HTML 58.11% CSS 6.08%
web-components custom-elements textarea autogrow html

custom-textarea's Introduction

<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

or reference directly:

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

Usage

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

or

// 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

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

<!-- or for the ES5 version -->

<script src="https://unpkg.com/@lemmon/custom-textarea/dist/es5.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

custom-textarea's People

Contributors

lemmon avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.