@nent/core
v0.10.8
Published
Functional elements to add routing, data-binding, dynamic HTML, declarative actions, audio, video, and so much more. Supercharge static HTML files into web apps without script or builds.
Downloads
1,701
Readme
NENT: Web Application Elements
NENT is a set of Web Components that enables designers to add functionality to static HTML. No code, no build process, just simple and powerful functionality.
⚠️ This project is still under development. Expect breaking changes until the 1.0 release.
Why use NENT?
NENT is a small library that allows you to include interactivity and animations to your static HTML pages. No framework, no build process, no code needed. Just include the JS file and add the elements where you need functionality within the semantics of HTML.
Declared Functionality
Each element encapsulates a feature or functionality such as routing, dynamic content, data-merged templates, and reusable partials. Each element is lightweight and lazy-loaded, so they can be individually used without pulling in an entire framework or library.
Declarative-Applications:
- Easy to understand and reason about
- Easy to maintain, with reduced side-effects
- Deterministic and testable with static-analysis
- More approachable to a wider range of skill levels
- FUN! HTML as it was meant to be.
Element Groups
The elements are named and grouped by their sub-system. In some cases, shared services are enabled with a system-level element.
Sub-systems add functionality to other systems. For instance, view routes can use data expressions in their content when the data system is included.
View Router: <n-views-*>
In-page routing and navigation elements with no dependencies.
- Single Page Application Routing
- Fast navigation between views
- Page History
- Route Transitions
- Nested Layouts
- Nav Links with Active Route detection
- Nav Lists:
Nav-Bars, Child Menus, and Breadcrumbs - Guided Navigation
Content: <n-content-*>
Independent content elements for managing the HTML on the page.
- Content Templates
- Deferred Content
- Content Data Injection
- Markdown Rendering
- Remote HTML / Partials
App: <n-app-*>
Option elements to add robust application features to the HTML file with no dependencies.
- App Console Logging
- App Theme Detection & Control
- UI Component Kit Integrations (Ionic, shoelace, Material, etc)
- PWA Support (coming)
- Expose Event/Actions to the DOM
Actions: <n-action-*>
Data structure elements to declare functions and their activations.
- Declared Actions
- Reactive Activators
- Add Custom Async Functions
Data: <n-data-*>
Optional enhancements elements to add data-functionality and data-providers.
- Expression Evaluation
- Token Resolution
- Conditional Rule Evaluation
Elements: <n-elements>
Optional enhancement to add DOM manipulation features to other NENT elements. It also enables declarative actions for DOM updates.
Audio: <n-audio-*>
Optional audio element to orchestrate declarative audio playback.
- Voice-over Audio
- Event Sounds
- Background Music
Analytics: <n-analytics>
Optional action listener to delegate events and route changes to any analytics provider (minor scripting required).
- Page Views
- View Times
- Custom Events
Video: <n-video-*>
Optional wrapper element to normalize video events between various video players to enable media-timed events for synchronized actions. Useful for automatically navigating when a video ends or updating the content based on the video time.
Get Started
You can spike out a new NENT project with the script reference in place, or follow the installation instructions below for an existing HTML file.
npm create @nent my-nent-app
Installation
ℹ️ Note: This is a pre-release project and is subject to breaking changes and incomplete features. Thank you for trying it out!
Add a single script reference to the page head and the library is ready to go.
The initial download is under 1K!
Each component you use is lazy-loaded when you first use one. Most are tiny, with the largest around 60k.
CDN
<head>
<script
type="module"
src="https://cdn.jsdelivr.net/npm/@nent/core/dist/esm/nent.js"
></script>
</head>
NPM
<head>
...
<script
type="module"
src="~/node_modules/@nent/core/dist/nent/nent.esm.js"
></script>
....
</head>
npm i @nent/core
# or
yarn add @nent/core
Show your Love
If you use NENT and want to help spread the word, put a NENT badge on your readme or your website.
NENT badge:
Markdown
[![NENT](https://badgen.net/badge/Powered%20by/NENT/purple)](https://nent.dev)
HTML
<a href="https://nent.dev" target="_blank">
<img alt="Powered by NENT"
src="https://badgen.net/badge/Powered%20by/NENT/purple"/>
</a>
Learn More
The best way to see what these elements in action, is to take a look at the documentation demo. The installable app is built using these elements in a single HTML file (with child-routes and partials lazy-loaded, as-needed).
Contact
If you like the idea, join us! Or give it a star.
If you have requests, ideas, or feedback, reach out to us:
Attribution
Built on the shoulders of giants
Thank you to the Ionic team and their fabulous Stencil.js SDK for the best way to build lightning-fast, native elements.
Also, thank you to the creators and contributors to all open-source efforts, but especially to the libraries we love and use in our plugin components:
- expr-eval: declarative expression parser used in n-data
- jsonata: declarative data query/filter/transformation used in n-content-repeat
- howler: easy-to-use audio playback tools used in n-audio
- remarkable: ridiculously fast markdown processing. used in n-content-markdown