
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@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 2 weekly downloads. As such, @dwightbcoder/action-ui popularity was classified as not popular.
We found that @dwightbcoder/action-ui demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.