1.0.2 • Published 4 years ago

json-bootstrap v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

json-bootstrap

Converts your JSON data into Bootstrap.

Install

Install with npm:

$ npm install json-bootstrap

Install with yarn:

$ yarn add json-bootstrap

Usage

const jsonBootstrap = require('json-bootstrap');

Methods

alert()

Exposes a single dimension JSON array as Bootstrap Alerts.

Usage

alert(items, type, encoded, dismiss, title, className)

Parameters

ParameterDescription
itemsArray of strings.
typePossible values (primary, secondary, success, danger, warning, info, light, dark).
encodedThe items will be html encoded.
dismissClose button in the alert.
titleTitle of the alert.
classNameClass name to be added on each item.

Example

const jsonBootstrap = require('json-bootstrap');

const errors = [
    'Your username must start with a letter',
    'Your username must have at least 2 characters.'
]

console.log(jsonBootstrap.alert(errors, 'danger', true, true, false, 'errors'))

card()

Generates a Bootstrap Card.

form()

Build a Bootstrap Form from a JSON object with properties.

table()

Creates a Bootstrap Table from a JSON array of objects.

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Guilherme Cruz

License

Copyright © 2020, Guilherme Cruz. Released under the MIT License.


1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago