hardview

Create framework-free UI components with vanilla JavaScript and native DOM APIs.

419|12|Updated Dec 2, 2018
One-click install
npx skills add https://github.com/matthewp/views-the-hard-way --skill hardview
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hardview
Source: https://github.com/matthewp/views-the-hard-way/tree/main/skills/hardview
Command: npx skills add https://github.com/matthewp/views-the-hard-way --skill hardview

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building UIs without frameworks can lead to spaghetti code, inconsistent patterns, and performance pitfalls. This skill provides a structured approach for crafting vanilla JavaScript views that are maintainable, predictable, and high-performance.

Core Features & Use Cases

  • Template-first architecture using a <template> element for HTML structure.
  • Dedicated clone() and init() functions that encapsulate rendering and state logic.
  • Update cycle pattern: update() returns a renderable DOM and supports props down, events up.
  • Optional composition with child views and explicit DOM/State update functions.
  • Use cases: building small, framework-free UI components, widgets, or micro-views that can be embedded anywhere.

Quick Start

Import the skill's init function and call it to create an update function, then render the returned element into your page by passing the initial props.

Frequently Asked Questions about hardview

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build vanilla JavaScript UI components without a framework?

Build vanilla JavaScript UI components by using a template-first architecture with native DOM APIs. This approach enforces a structured init/update lifecycle and dedicated update functions for DOM mutation, ensuring predictable rendering and maintainable code without dependencies.

What is the best way to manage state in framework-free web components?

Manage state in framework-free web components using a Props Down, Events Up data flow with single-responsibility state variables. This pattern isolates state logic within dedicated clone() and init() functions, ensuring predictable DOM updates through structured update cycles.

How do I create reusable widgets with zero dependencies?

Create reusable widgets with zero dependencies by defining a <template> element for HTML structure and encapsulating rendering logic within clone() and init() functions. The update() function then returns a renderable DOM node ready for embedding anywhere.

Can I compose child views in vanilla JS DOM manipulation?

You can compose child views in vanilla JS DOM manipulation through optional composition with explicit DOM and state update functions. This allows isolated micro-views and simple dashboards to maintain a structured init/update lifecycle while keeping rendering predictable.

When should I use vanilla JS for DOM manipulation instead of a UI framework?

Use vanilla JS for DOM manipulation instead of a UI framework when building isolated widgets, simple dashboards, or micro-views where zero dependencies and predictable rendering are essential, and the overhead of a framework is unnecessary for the view's complexity.