Giter VIP home page Giter VIP logo

ember-floating-labels's Introduction

@gavant/ember-floating-labels

Animated floating placeholder form labels for Ember apps.

Demo: https://gavant.github.io/ember-floating-labels/

Compatibility

  • Ember.js v3.24 or above
  • Ember CLI v3.24 or above
  • Node.js v12 or above

Installation

ember install @gavant/ember-floating-labels

To use the addon styles, you must use SASS:

ember install ember-cli-sass

(Upon addon installation, an import statement will be added to your app.scss)

Usage

An example <FlInput> usage, with all available arguments specified. Only @value and @placeholder are required, and you may pass in normal HTML attributes as well which will be applied to the <input> element (e.g. type="email", or disabled={{true}}, class="some-custom-input-class" etc).

@inset={{true}} enables an alternate styling, where the floating label will remain constrained inside of the input element, instead of overlaid on its top border.

<FlInput
    @value={{string}}
    @placeholder={{string}}
    @containerClass={{string}}
    @inputBaseClass={{string}}
    @inset={{boolean}}
/>

{{! block form is supported too }}
<FlInput @value={{this.someValue}} @placeholder='Block input'>
    <Input @value={{this.someValue}} placeholder='Look ma, block content!' />
</FlInput>

NOTE: When using block form, make sure to still pass in a @value, so the label knows when to remain "floated".

There are also floating label components for <select> & <textarea> fields:

<FlSelect
    @options={{array<object>}}
    @value={{string}}
    @valuePath={{string}}
    @labelPath={{string}}
    @emptyOptionText={{string}}
    @allowClear={{boolean}}
    @onChange={{function}}
    @placeholder={{string}}
    @containerClass={{string}}
    @inputBaseClass={{string}}
    @inset={{boolean}}
/>
<FlTextarea
    @value={{string}}
    @placeholder={{string}}
    @containerClass={{string}}
    @inputBaseClass={{string}}
    @inset={{boolean}}
/>

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

ember-floating-labels's People

Contributors

abaker-gavant avatar bakerac4 avatar bdami-gavant avatar billdami avatar dependabot[bot] avatar gspain avatar gspain-gavant avatar napafundi avatar

Watchers

 avatar  avatar  avatar  avatar

ember-floating-labels's Issues

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.