0.5.0 β€’ Published 2 years ago

@voxjs/vox v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vox.js

⚑️ INSTANT INTERACTIVITY FOR THE WEB πŸ’«

Vox is a tiny (β‰ˆ7KB) JavaScript library that allows you to enhance your HTML with declarative two-way data bindings, using simple, native-like attributes (directives).

npm.io
npm.io

β€Ž

<script src="vox.min.js"></script>

<div vox="{ world: [ '🌏', '🌍', '🌎' ] }">
  hello, <span vox:text="world.join(' ')"></span>!
  <br/>
  <button vox:onclick.once="world.push('πŸ‘½')">
    click...
  </button>
</div>

<script>
  const app = vox();
  app.init();
  // ...that's all, folks!
  app.exit();
</script>

β€Ž

DOCUMENTATION

HOME
INSTALLATION
MAIN CONCEPTS
API REFERENCE
SHOPIFY
RESOURCES

β€Ž

demo or it didn't happen.

πŸ”— <counter/>

<div vox="{ count: 0 }">
  <button vox:onclick="(count--)">
    &minus;
  </button>
  <span vox:text="(count)"></span>
  <button vox:onclick="(count++)">
    &plus;
  </button>
</div>

β€Ž

πŸ”— <dialog/>

<div vox="{ open: false }">
  <button vox:onclick="(open = !open)">
    click
  </button>
  <div vox:if="(open)">
    hi! πŸ‘‹
  </div>
</div>

β€Ž

πŸ”— <tabs/>

<div vox="{ tab: 0 }">
  <button vox:onclick="(tab = 1)">
    tab 1
  </button>
  <button vox:onclick="(tab = 2)">
    tab 2
  </button>
  <button vox:onclick="(tab = 3)">
    tab 3
  </button>
  <div vox:hidden="(tab !== 1)">
    cupcake 🧁
  </div>
  <div vox:hidden="(tab !== 2)">
    cookie πŸͺ
  </div>
  <div vox:hidden="(tab !== 3)">
    chocolate 🍫
  </div>
</div>

β€Ž

πŸ”— <to-dos/>

<div vox="{ todos: [ 'β˜•οΈ', 'πŸ’»', 'πŸ’€' ] }">
  <ol vox:if="(todos.length > 0)">
    <li vox:for="(todo in todos)">
      <span vox:text="(todo)"></span>
      <button vox:onclick="{
        todos.splice(todos.indexOf(todo), 1);
      }">
        &times;
      </button>
    </li>
  </ol>
  <form vox:onsubmit.prevent="{
    todos.push(els.input.value || '…');
    els.input.value = '';
  }">
    <input placeholder="…" vox:el="('input')"/>
    <button>add to-do</button>
  </form>
</div>

β€Ž

COPYRIGHT Β© 2021 PAULA GRIGUΘšΔ‚ AND CONTRIBUTORS

0.5.0

2 years ago

0.3.0

2 years ago

0.4.0

2 years ago

0.1.2

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.1.1

2 years ago

0.0.0

3 years ago