image
Akan.js
English
DocsConventionsReferencesCheatsheet
image
Akan.js
Akan.js v2 docs are now available.View the v1 docs
DocsConventionsReferencesCheatsheet
Released under the MIT License
Official Akan.js Consulting onAkansoft
Copyright © 2026 Akan.js All rights reserved.
System managed bybassman
Workspace Convention
• Structure
• Format & Lint
App & Library Convention
• Assets (public/ private/)
• Components (ui/)
• Server Utils (srvkit/)
• Web Utils (webkit/)
• Common Utils (common/)
• akan.config.ts
Domain Convention
• Overview
• model.constant.ts
• model.dictionary.ts
• model.document.ts
• model.service.ts
• model.signal.ts
• model.store.ts
• Model.Template.tsx
• Model.Unit.tsx
• Model.Util.tsx
• Model.View.tsx
• Model.Zone.tsx
Scalar Convention
• Overview
• scalar.constant.ts
• scalar.dictionary.ts
• scalar.document.ts
• Scalar.Template.tsx
• Scalar.Unit.tsx
Service Convention
• Overview
• service.dictionary.ts
• service.service.ts
• service.signal.ts
• service.store.ts
• Service.Util.tsx
• Service.Zone.tsx
Workspace Convention
• Structure
• Format & Lint
App & Library Convention
• Assets (public/ private/)
• Components (ui/)
• Server Utils (srvkit/)
• Web Utils (webkit/)
• Common Utils (common/)
• akan.config.ts
Domain Convention
• Overview
• model.constant.ts
• model.dictionary.ts
• model.document.ts
• model.service.ts
• model.signal.ts
• model.store.ts
• Model.Template.tsx
• Model.Unit.tsx
• Model.Util.tsx
• Model.View.tsx
• Model.Zone.tsx
Scalar Convention
• Overview
• scalar.constant.ts
• scalar.dictionary.ts
• scalar.document.ts
• Scalar.Template.tsx
• Scalar.Unit.tsx
Service Convention
• Overview
• service.dictionary.ts
• service.service.ts
• service.signal.ts
• service.store.ts
• Service.Util.tsx
• Service.Zone.tsx
Previous
Model.Template.tsx
Next
Model.Util.tsx

Model.Unit.tsx

A Unit file contains reusable renderers for one model item or one list/table representation. Common exports are cards, compact rows, avatars, gallery tiles, and column helpers.
Units are usually presentational. They may include thin UI actions such as edit buttons, but forms belong in Template files and larger interactions belong in Util or Store.

ModelProps And Light Models

Use ModelProps to type the model prop, href, className, and common interaction props. Unit components usually receive Light models because they are rendered repeatedly in lists.
Article.Unit.tsx

Unit Variants

A single Unit file can export several display shapes for the same model. Name them by usage: Card for normal cards, Mini for compact rows, Abstract for feed/list summaries, Gallery for image grids.
Units are server components by default, so avoid putting browser events such as onClick directly in the Unit. Move interactive behavior into a small Util component, such as Article.Util.Remove, and compose it from the Unit.
Article.Unit.tsx
Article.Unit.tsx

Actions Inside Units

Units may show small UI actions such as remove, copy, or detail buttons. Keep the Unit thin: render a small Util component for the browser behavior, while forms and async workflows stay outside the Unit.
Article.Unit.tsx

Load.Units And Direct Rendering

Use Load.Units when a slice manages loading, pagination, refresh, and empty states. If the page already has an array, render Units directly with map, which is common in server-rendered pages.
Load.Units also hydrates slice state into the client store so generated pagination, query, sort, refresh, and insight helpers can keep working after the first render.
fieldDescriptionExample
<model>List<Suffix>The hydrated list rendered by Load.Units. This is the current visible list state.
<model>InitList<Suffix>The first list snapshot from the server init object. It is useful for reset or comparison flows.
<model>InitAt<Suffix>Timestamp for when the server initialized the list.
<model>ListLoading<Suffix>Marks the list as ready after hydration.
<model>Insight<Suffix>Insight data returned with the slice, such as count or summary values.
st.pageOf<Model><Suffix> / st.lastPageOf<Model><Suffix> / st.limitOf<Model><Suffix>Pagination state hydrated from the init object.
st.queryArgsOf<Model><Suffix>The current query arguments used to load the slice.
st.sortOf<Model><Suffix>The current sort value used to load the slice.
<model>List<Suffix>

The hydrated list rendered by Load.Units. This is the current visible list state.

<model>InitList<Suffix>

The first list snapshot from the server init object. It is useful for reset or comparison flows.

<model>InitAt<Suffix>

Timestamp for when the server initialized the list.

<model>ListLoading<Suffix>

Marks the list as ready after hydration.

<model>Insight<Suffix>

Insight data returned with the slice, such as count or summary values.

st.pageOf<Model><Suffix> / st.lastPageOf<Model><Suffix> / st.limitOf<Model><Suffix>

Pagination state hydrated from the init object.

st.queryArgsOf<Model><Suffix>

The current query arguments used to load the slice.

st.sortOf<Model><Suffix>

The current sort value used to load the slice.

Load.Units
Direct SSR rendering

Practical Rules

Use Light models for lists and repeated Unit rendering.
Accept className and href when the Unit may be reused in different layouts or links.
Use clsx to merge caller styling with the Unit's base styling.
Prefer Layout.Unit or Link for clickable card/list containers.
Keep forms in Template and complex async interactions in Util or Store.
Export variants by display purpose instead of adding many flags to one Card.
Model.Unit.tsx
ModelProps And Light Models
Unit Variants
Actions Inside Units
Load.Units And Direct Rendering
Practical Rules