ruppy

0.1.1 • Public • Published

ruppy npm npm GitHub issues

Small 3kb rendering library

Example

import { Component, render } from 'ruppy'

const Lorem = new Component({
  element: 'div',
  _content: `Lorem ipsum dolor sit amet, consectetur adipisicing elit.
  Tempore architecto, culpa doloremque porro!
  Sunt quae nulla voluptates deserunt commodi magni consequatur, voluptas impedit.
  Itaque, consectetur, ex! Omnis ipsa sunt nostrum.`
})

render({
  entry: '#app',

  header: {
    className: 'header',
    _content: `Header`
  },
  main: {
    components: [
      Lorem
    ]
  }
})

API

component = new Ruppy.Component([opts])

Initialize a new ruppy component

  • opts._content - Component content
  • opts.className - Component's class
  • opts.components - Array of Components
  • opts.element - Element that Component is render into (Any string => 'div', 'form', ...)

Ruppy.render([opts])

Renders ruppy into DOM

  • opts.entry - Ruppy rendering selector ('#app', ...)
  • opts.header - Header
    • opts._content - Header content
    • opts.className - Header class
    • opts.components - Header's array of Components
  • opts.main - Main
    • opts._content - Main content
    • opts.className - Main class
    • opts.components - Main's array of Components

Readme

Keywords

none

Package Sidebar

Install

npm i ruppy

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • kocisov