All Projects → richardvenneman → Floatl

richardvenneman / Floatl

☁️ A pragmatic implementation of the Float Label Pattern for the web

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Floatl

react-cool-form
😎 📋 React hooks for forms state and validation, less code more performant.
Stars: ✭ 246 (+20.59%)
Mutual labels:  ux, form
Vue Content Loading
Vue component to easily build (or use presets) SVG loading cards Facebook like.
Stars: ✭ 729 (+257.35%)
Mutual labels:  ux, placeholder
React Cool Img
😎 🏞 A React <Img /> component let you handle image UX and performance as a Pro!
Stars: ✭ 356 (+74.51%)
Mutual labels:  ux, placeholder
Framy Css
Very simple CSS Framework
Stars: ✭ 103 (-49.51%)
Mutual labels:  ux, form
React Native Blurhash
🖼️ A library to show colorful blurry placeholders while your content loads.
Stars: ✭ 430 (+110.78%)
Mutual labels:  ux, placeholder
Rn Placeholder
🏖️ Display some placeholder stuff before rendering your text or media content in React Native
Stars: ✭ 1,934 (+848.04%)
Mutual labels:  ux, placeholder
Ocskeleton
[OCSkeleton] - Make your loading view a little difference.
Stars: ✭ 184 (-9.8%)
Mutual labels:  placeholder
Animatable Component
Animate once, use Everywhere! 💫
Stars: ✭ 188 (-7.84%)
Mutual labels:  ux
Jquery.redirect
jQuery Redirect Plugin
Stars: ✭ 182 (-10.78%)
Mutual labels:  form
Vue Morphling
Vue filters and directives collection.
Stars: ✭ 179 (-12.25%)
Mutual labels:  placeholder
Django Material
Material Design for Django
Stars: ✭ 2,362 (+1057.84%)
Mutual labels:  form
Form
The Form component allows you to easily create, process and reuse HTML forms.
Stars: ✭ 2,406 (+1079.41%)
Mutual labels:  form
Flutter Ui Kit
A repository full of beautiful UI examples in Flutter
Stars: ✭ 188 (-7.84%)
Mutual labels:  ux
Qmbform
Create simple Android forms
Stars: ✭ 184 (-9.8%)
Mutual labels:  form
Lunacy Docs
Documentation for Lunacy, Graphic Design Software with built-in assets
Stars: ✭ 190 (-6.86%)
Mutual labels:  ux
Statefulviewcontroller
Placeholder views based on content, loading, error or empty states
Stars: ✭ 2,139 (+948.53%)
Mutual labels:  placeholder
Pristine
Vanilla javascript form validation micro-library
Stars: ✭ 197 (-3.43%)
Mutual labels:  form
React Redux Form
Create forms easily in React with Redux.
Stars: ✭ 2,099 (+928.92%)
Mutual labels:  form
Awesome Design
🌟 Curated design resources from all over the world.
Stars: ✭ 13,333 (+6435.78%)
Mutual labels:  ux
Epage
一款基于schema的可视化页面配置工具
Stars: ✭ 194 (-4.9%)
Mutual labels:  form

☁️ Floatl

A pragmatic implementation of the Float Label Pattern for the web.

NPM Build Status Maintainability Test Coverage

Floatl

Try it for yourself: https://richardvenneman.github.io/floatl/

Features

🤙 Supports textfields and textareas

🏝 Dependency-free and maintained

⚡️ Small size, < 1Kb gzipped

🤣 Oldie browser support Sauce Test Status

* Supports IE8 & IE9 as well, but I couldn't get them to run on SauceLabs 😰

Installation

Floatl is built primarily for module bundlers such as Browserify and webpack. As such it is distributed via NPM.

yarn add floatl # or npm i -S floatl

An UMD build is available from the GitHub releases page if you're not using a module bundler. This version adds Floatl to the global namespace.

Styling

Add the required styling to your app. Please refer to the GitHub wiki page on styling for more information.

Usage

NOTE: Check the GitHub wiki page for instructions on how to use with React, AngularJS and Stimulus.

Markup your label and input (or textarea) with the floatl classes and wrap them in an element with the floatl class:

<div class="floatl">
  <label for="first_name" class="floatl__label">First name</label>
  <input name="first_name" class="floatl__input" placeholder="First name" type="text" />
</div>

Instantiate Floatl by passing in the wrapping DOM element:

import Floatl from "floatl";

var element = document.getElementById("my-floatl-element");
new Floatl(element);

Destroying instances

If you keep a reference to your Floatl instance, it's easy to remove all of the event handlers by calling the destroy instance method:

var myFloatl = new Floatl(element);
myFloatl.destroy()

Placeholder polyfilling

While the JavaScript supports IE8+, Floatl aims to be good at Floating Labels and only that. The Floating Labels Pattern works best with placeholders and it is therefor recommended to install legacy browser placeholder support should you need it, for example Placekeeper or Placeholders.js.

Motivations

There are several libraries available that implement the Float Label Pattern, most notably floatlabels.js and FloatLabel.js. However, these libraries did not quite fulfill the requisites I had in mind (see features above) and I did not find any Bower compatible libraries when I started this project. Furthermore I like to use a well-maintained library. Since we're using this library in production at CitySpotters I'm keeping this library up to date.

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

  • Report bugs
  • Fix bugs and submit pull requests
  • Write, clarify, or fix documentation
  • Suggest or add new features
  • Write missing tests
  • Improve the TypeScript implementation

Development & testing

This project uses Jasmine with the Karma Test Runner.

  • Install dependencies with yarn install
  • Run the test suite with: yarn test (or yarn run tdd for Test Driven Development)

License

This library is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].