Git Product home page Git Product logo

ember-autoresize's Introduction

Ember AutoResize Ember Observer Score Code Climate

Note: if you're using a version of Ember less than 1.12.0, then please use 0.4.1 of this addon.

Ember AutoResize is an Ember-CLI addon for providing autoresize functionality to Ember. This package currently provides the necessary bootstrapping for {{input}} and {{textarea}} components.

To play with the addon, look at our demo. (Note: The demo is a bit out of date, check the documentation below for proper usage.)

Usage

To enable autoresizing on an input, add the following to your handlebars:

{{input autoresize=true}}

Refresh your page, and you should see that when you type in your text field, it automatically resizes to fit the text.

Textareas work exactly the same way:

{{textarea autoresize=true}}

Options

max-width

Set the maximum width of the resizeable element. If no unit is provided, it assumes that it's in pixels.

{{input autoresize=true max-width=200}}

max-height

Set the maximum width of the element. If no unit is provided, it assumes that it's in pixels.

{{input autoresize=true max-height=300}}

rows

Set the minimum number of rows for the element. Recommended for textareas.

{{textarea autoresize=true rows=2}}

max-rows

Set the maximum number of rows for the element. Recommended for textareas.

{{textarea autoresize=true max-rows=10}}

Installation

ember install ember-autoresize

Roadmap

  • Optimize style lookups
  • Font fitting
  • Clearer ways to enable autoresizing on templates

Contributing

Contributors are welcome! Please provide a reproducible test case. Details will be worked out on a case-per-case basis. Maintainers will get in touch when they can, so delays are possible. For contribution guidelines, see the code of conduct.

Publishing Documentation

To publish documentation (under the tests/dummy directory) run the following command:

npm run-script publish-docs

ember-autoresize's People

Contributors

danmcclain avatar elwayman02 avatar go1dfish avatar ktkate avatar mixonic avatar rwjblue avatar scotttravis avatar tim-evans avatar zeppelin avatar

Watchers

 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.