Skip to content
DevinimJS
v0.6.0-beta.0 · AI-first authoring

Small APIs. Explicit contracts.

Everything needed to author components, manage state and build a browser-native application layer. The concise component() path is designed for people and coding agents alike.

01 · Install

One pinned import

Load CKCSS for presentation and DevinimJS for interaction. Runtime consumers need no npm package.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kayacuneyd/ckcss@v0.1.0-beta.1/dist/ckcss.min.css">
<script type="module" src="https://cdn.jsdelivr.net/gh/kayacuneyd/devinimjs@v0.5.1/dist/modules/dv-tabs.js"></script>

<dv-tabs data-label="Account settings">
  <section data-tab="Profile">Profile content</section>
  <section data-tab="Billing">Billing content</section>
</dv-tabs>
02 · Contract

Build-free compatibility

Runtime

Zero npm/runtime dependencies. Native ES modules run directly in modern browsers.

Distribution

dist/ is optional optimization. Source modules remain a supported browser entry point.

New features must first work in the source runtime, then be added to the distribution. No compile-time template analysis, code generation or framework runtime is allowed.

03 · Default authoring path

One component object. No compiler.

Import component and html; declare typed props, local state, optional live sync, named actions and one view. A .dv.js file is ordinary browser JavaScript.

Live browser-direct demo

Click to run the same API shown here.

Shared-hosting compatible

Copy authoring.min.js and your .dv.js file to a static host. No Node process, compilation or server runtime is involved.

import { component, html } from '/assets/authoring.min.js';

component('acme-counter', {
  props: { start: 0, step: 1 },
  state() { return { count: this.props.start }; },
  sync: { start(value) { this.state.count = value; } },
  actions: { increment() { this.state.count += this.props.step; } },
  view() { return html`<button on:click="increment">${this.state.count}</button>`; },
});

Rule of thumb: use this path for ordinary components. Use BaseComponent only for advanced child capture, lifecycle orchestration or custom store work.

04 · Advanced

Core API

Public core primitives
APIPurposeAgent rule
componentDefault concise component factory.Use it first for new components.
BaseComponentProxy-reactive custom-element base class.Use it as an advanced escape hatch.
htmlEscaping template tag.Return it from view() or template().
createStoreShared state and subscriptions.Keep ownership at page/application level.
morphFocused DOM reconciliation.Use stable data-key for moving lists.
unsafeExplicit raw HTML boundary.Only use independently sanitized HTML.
import { BaseComponent, html, define } from 'https://cdn.jsdelivr.net/gh/kayacuneyd/devinimjs@v0.5.1/dist/core.min.js';

class AcmeGreeting extends BaseComponent {
  initialState() { return { name: this.str('name', 'World') }; }
  template() { return html`<p>Hello ${this.state.name}</p>`; }
}

define('acme-greeting', AcmeGreeting);
04 · Application runtime

Opt-in tools for richer pages

Import app.min.js only when a page needs async data, JSON requests, forms or hash routing.

import { createAsyncState, fetchJson, createForm, createHashRouter } from 'https://cdn.jsdelivr.net/gh/kayacuneyd/devinimjs@v0.5.1/dist/app.min.js';

const products = createAsyncState();
products.run(() => fetchJson('/api/products.json'));
const checkout = createForm({ email: '' });
const router = createHashRouter().add('/', 'home').add('/products/:id', 'product');
router.start();
Data flow guidance

Keep requests and persistence in page/application code. Components receive attributes or page-owned data and publish semantic dv:* events.

05 · Components

Component contract

Components follow dv-kebab.jsDvPascaldefine('dv-kebab', ...). Configuration uses data-*; outbound communication uses bubbling dv:* CustomEvents.

Shipped component families
FamilyComponentsEvents
Foundationdv-counter, dv-tabs, dv-disclosure, dv-modalchange, tab, toggle, open/close
Forms/discoverydv-field, dv-confirm, dv-search, dv-autocompleteinput, change, query, select, confirm
Data/commercedv-data-table, dv-pagination, dv-product-card, dv-cartsort, page, add-to-cart, remove
Feedback/statedv-toast, dv-toast-stack, dv-stateshow, hide, retry
Open live component catalog
06 · Accessibility

Native behavior is the baseline

Prefer native controls. Interactive components define keyboard behavior, focus behavior, labels, roles and live-region semantics. Tabs follow the WAI-ARIA tabs pattern; dialogs restore focus and close on Escape; status messages use polite announcements.

Release check

Run npm run verify before release. It includes lint, unit tests, browser tests and the core size gate.

07 · Security

Escaped by default

Interpolated template values are escaped. The unsafe() boundary is explicit and must only receive independently sanitized HTML. Keep backend data in attributes or JSON and treat it as untrusted input.

08 · AI agents

Give agents a reliable map

Start with llms.txt for orientation, then use llms-full.txt and the component manifest for exact contracts.

Golden path

Generate with npm run create:component -- acme-card --format=dv. Keep external values in props, use on:event for actions, add the unit test and manifest entry, then run npm run validate:component -- acme-card.