@null-none/hyper-view

1.0.1 • Public • Published

hyper-view

Full-featured HTMX-style micro library with WebSocket, history, spinner, and more

<!-- Button with GET request -->
<button hv-get="/api/time" hv-target="#result" hv-swap="innerHTML">Show Time</button>
<div id="result">Result will appear here</div>

<!-- Button with POST request and parameters -->
<button hv-post="/api/hello" hv-params='{"name": "Ivan"}' hv-target="#greeting">Say Hello</button>
<div id="greeting"></div>

<!-- Form example -->
<form hv-post="/api/send" hv-target="#status">
  <input name="email" placeholder="Your email">
  <button type="submit">Send</button>
</form>
<div id="status"></div>

<!-- Auto-load content on page load -->
<div hv-get="/api/hello" hv-target="#autoload" hv-trigger="load"></div>
<div id="autoload"></div>

<!-- WebSocket connection -->
<div hv-ws="ws://localhost:8000/ws" hv-swap="innerHTML"></div>

Readme

Keywords

none

Package Sidebar

Install

npm i @null-none/hyper-view

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

13.8 kB

Total Files

7

Last publish

Collaborators

  • null-none