image
Akan.js
English
Docs (V1)
image
Akan.js
You are viewing the Akan.js v1 docs.Go to the latest v2 docs
Docs (V1)
Released under the MIT License
Official Akan.js Consulting onAkansoft
Copyright © 2026 Akan.js All rights reserved.
System managed bybassman
Introduction
• Quick Start
• How it works
• Practice a Workflow
Tutorials
• Show Details
• Modifying Status
• Interact in Service
• Displaying with Slice
• UX with Pages
• Using Scalar
• Using Insight
• Relate Data
System Architecture
• Overview
• Backend System
• Frontend System
• Environment Variables
• Primitive Scalar Types
• Domain Based Modules
• CSS
Module 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
Introduction
• Quick Start
• How it works
• Practice a Workflow
Tutorials
• Show Details
• Modifying Status
• Interact in Service
• Displaying with Slice
• UX with Pages
• Using Scalar
• Using Insight
• Relate Data
System Architecture
• Overview
• Backend System
• Frontend System
• Environment Variables
• Primitive Scalar Types
• Domain Based Modules
• CSS
Module 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
Next
Quick Start

model.Template.tsx

Templates are UI components dedicated to rendering forms for a specific Model. They bridge the gap between the Store (state) and the Page (layout).
🎨Presentational Component
Templates should focus on UI layout and field rendering. Business logic should remain in the Store or Service.

File Convention

Templates are located in the library directory corresponding to their Model. The filename must follow the PascalCase convention.
lib/[model]/[Model].Template.tsx

Standard Structure

A Template file typically exports one or more functional components. Each component should accept a className prop.
Example Code
Product.Template.tsx

Template Usage Patterns

Templates are designed to be used within wrapper components that handle data loading, modal management, and form submission contexts.
1. In Modal (Model.Edit)
Use 'Model.Edit' to render the template inside a modal or an inline edit view. The wrapper handles the edit state based on the slice Name and model ID.
Ticket.Util.tsx
2. In Page (Load.Edit)
Use 'Load.Edit' for full-page editing scenarios where data is pre-fetched by a loader. It connects the 'edit' object from the loader to the Template.
EditPage.tsx

Template Best Practices

1️⃣Use Layout.Template
Always wrap the content in <Layout.Template> to ensure consistent padding and spacing within the form context.
2️⃣Use Auto-Generated Actions
Bind 'onChange' directly to 'st.do.set[Field]On[Model]' whenever possible. This reduces boilerplate code.
3️⃣Split Large Forms
If a model has many fields, create multiple components (e.g., General, Detail, Settings) in the same file to organize them logically.
model.Template.tsx
File Convention
Standard Structure
Template Usage Patterns
Template Best Practices