
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@dwightbcoder/action-ui
Advanced tools
Action UI is a Javascript framework to simplify connecting actions to user interface elements
Action UI is a ES6 Javascript framework for building event-base user interfaces
The goal of this package is to make decoupled event-driven API-powered websites and applications simpler to produce with minimal learning curve.
Please review the documentation via the Wiki
By default actions attached to HTML elements (via a ui-action attribute) will be configured automatically allowing Action UI to take control of form submission simply be setting an action name to the <form>:
<script src="https://cdn.jsdelivr.net/npm/@dwightbcoder/action-ui"></script>
<form ui-action="save post" action="/post/store" method="POST">
<label for="title">Title:</label><br>
<input type="text" name="title" placeholder="Post title"><br>
<br>
<label for="body">Body:</label><br>
<textarea name="body"></textarea><br>
<br>
<button type="submit">Save Post</button>
</form>
Whenever an action is triggered any element triggers will receive state CSS classes of loading, success, or fail.
For example disable form elements and show an overlay when it is submitted using CSS:
<style>
form.loading
{
position: relative;
pointer-events: none;
}
form.loading::after
{
content: "Saving...";
top: 0; left: 0;
width: 100%; height: 100%;
background-color: rgba(255,255,255,.75);
position: absolute; display: flex;
align-items: center; justify-content: center;
}
</style>
You can listen for action.after events for things like informing the user of success or failure:
document.addEventListener('action.after', e => {
if ( e.detail.name == 'save post' )
{
alert( e.detail.success ? 'Success!' : 'Failed!' )
}
})
Setup a simple index.html:
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/@dwightbcoder/action-ui"></script>
</head>
<body>
<header>Header</header>
<main ui-view="controller"></main>
<footer>Footer</footer>
<script>
ActionUI.Router.start()
</script>
</body>
</html>
Create your views:
view/
error.html
default/
index.html
You now have a simple SPA that will load view content from your external view html files and respond to to page navigation include reload, back, and forward.
FAQs
Action UI is a Javascript framework to simplify connecting actions to user interface elements
The npm package @dwightbcoder/action-ui receives a total of 4 weekly downloads. As such, @dwightbcoder/action-ui popularity was classified as not popular.
We found that @dwightbcoder/action-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.