Giter Site home page Giter Site logo

meteor-html-helpers's Introduction

Overview

Some Meteor Blaze helpers for HTML manupulations.

Installation

meteor add imajus:html-helpers

Related packages

Contents

Package provides following global Blaze helpers:

  • dump(...args) – Returns JSON-fied args as a string.
<pre>{{dump currentUser currentRoute}}</pre>
  • activeClass(current, expected, initial) – When current equals expected, returns 'active' string literal. If initial value is true, helper returns 'active' for empty current value as well. To be used in lists-like interactive UI components, like menus. For more general helper which you can use to return other string literal rather than 'active', see when from imajus:common-helpers.
<ul class="menu">
  <li class="{{activeClass currentRoute 'home' true}}">Home</li>
  <li class="{{activeClass currentRoute 'contact'}}">Contact Us</li>
  ...
</ul>
  • numberClass(num) – Returns one of 'positive', 'negative' or 'zero' literal values depending on num value.
  • selected(current, expected, initial) – Adds selected attribute when current equals expected. If initial value is true, helpers will also adds attribute in case of current is empty.
<select>
  <option {{selected value 'first' true}}>First</select>
  <option {{selected value 'second'}}>Second</select>
</select>
  • checked(current, expected, initial) – Adds checked attribute when current equals expected. If initial value is true, helpers will also adds attribute in case of current is empty.
<input type="radio" {{checked value 'first' true}}> First
<input type="radio" {{checked value 'second'}}> Second
  • disabled(current, expected, initial) – Adds disabled attribute when current equals expected. If initial value is true, helpers will also adds attribute in case of current is empty.
<button {{disabled value 'first' true}}>First</button>
<button {{disabled value 'second'}}>Second</button>

meteor-html-helpers's People

Contributors

imajus avatar

Watchers

James Cloos 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.