Pure Coffee Views

An extension to coffee-views that adds YUI's pure views.


npm i --save coffee-views-pure

The when using Coffee Views mixin the prototype:

{Base} = require 'coffee-views'
Pure = require 'coffee-views-pure'
util = require 'util'

class MyView extends Base

  render: ->
    # ...

util._extend MyView.prototype, Pure

module.exports = MyView



Adds the pure-form class name to the form


Adds the pure-form-stacked class name to the form


Adds the pure-form-aligned class name to the form


Creates a grid in 2 ways.

Equal column grid

Pass an array and all the array items will be equally spaced.

@grid [
  -> @h2 'left'
  -> @h2 'right'

@grid [
  -> @h2 'left'
  -> @h2 'middle'
  -> @h2 'right'

Unequal grid

Pass an object with the keys as fractions.

  '1/3': -> @h2 'main'
  '2/3': -> @h2 'right'


Same as the grid() method, but responsive.


Creates a div with the pure-control-group class.


Creates a fieldset with the pure-group class.