deku-bloxparty-box

1.0.1 • Public • Published

deku-bloxparty-box Build Status

A simple Deku component to render a box with a title and children.

Install

npm install deku-bloxparty-box

Usage

 
import Box from 'deku-bloxparty-box'
import element from 'virtual-element'
 
export function render() {
  return element(Box, {class: 'SignIn-box', title: 'Sign In'}, [
    dom('input', {type: 'text', name: 'username'})
    dom('input', {type: 'password', name: 'password'})
    dom('button', {type: 'submit'})
  ])
}

Renders

<div class='SignIn-box bp-Box'>
  <div class='bp-Box-head'>
    <span class='bp-Box-title'>Sign In</span>
  </div>
  <div class='bp-Box-content'>
    <input type="text" name="username">
    <input type="password" name="password">
    <button type="submit">
  </div>
</div>

If you do not include a title property the div .bp-Box-head will not be rendered.

CSS

Default styles are available in src/index.css which may be consumed by a transpiler such as PostCSS.

License

MIT

Package Sidebar

Install

npm i deku-bloxparty-box

Weekly Downloads

4

Version

1.0.1

License

MIT

Last publish

Collaborators

  • kvnneff