View on GitHub

riot-placeholder

Riot.js tag for generating placeholder text.

riot-placeholder

build npm version codecov

NPM

Riot.js plugin for generating placeholder text.

About

riot-placeholder is a simple riot tag used for scaffolding and prototyping riot.js based websites and applications.

This tag was built with foobar-ipsum.

Examples

Usage

To install via NPM:

npm install riot-placeholder

For a quick start using jsdelivr:

<script src="https://cdn.jsdelivr.net/npm/riot-placeholder/dist/riot-placeholder.js"></script>

Once available, riot-placeholder can be used like so:

import riot from 'riot'
import placeholder from 'riot-placeholder'

placeholder(riot)

console.log(`John said "${riot.placeholder.word()}" I tell you!`)
<h1 data-is="ph"></h1>
<!-- override default unit (word, sentence, paragraph) -->
<!-- override default size (md) -->
<span data-is="ph" unit="sentence" size="lg"></span>
<p data-is="ph"></p>

The tag takes two configurable opts:

unit: Unit for generator to target.

By default, the tag will automatically determine the unit depending on the target node.

size: Size of the generated content (sm, md, lg).

Contributors

Contributing guidelines are as follows,


Copyright (c) 2017 John Nolette Licensed under the MIT license.