Card Architecture
Component Structure
Each card consists of three parts:- Vue Component (
*.vue) - The actual UI implementation - Metadata File (
*.ts) - Configuration and options definition - Documentation (
*.md) - Usage guide and examples
Registration System
Cards are automatically discovered and registered through:- New cards are automatically available once created
- No manual registration required
- Metadata is optional but recommended
Card Lifecycle
1. Definition
Cards are defined in YAML configuration:2. Rendering
The data form renderer:- Reads the YAML configuration
- Looks up the card type in the registry
- Instantiates the Vue component
- Passes properties as props
- Positions using grid layout
3. Interaction
Cards communicate through:- Props - Configuration from YAML
- Events - User interactions (clicks, edits, etc.)
- Store - Shared state (workspace, project, data stores)
Card Types
Container Cards
Purpose: Group and organize other cards Characteristics:supportsChildren: true- Render child cards inside
- Provide layout and visual structure
tabs- Tabbed interfacecardGroup- Visual groupingcardPanel- Titled panel with collapse
Data Display Cards
Purpose: Show read-only data Characteristics:supportsChildren: false- Display data from stores/APIs
- Often read-only
- Support filtering/sorting
dataStoreGrid- Tabular datadataObjectsTree- Hierarchical datalabel- Static text
Data Editor Cards
Purpose: Allow data modification Characteristics:- Interactive inputs
- Validation
- Save/update functionality
- Change tracking
dataAttributeEditor- Single field editortaxonGrid- Grid with inline editing
Specialized Cards
Purpose: Domain-specific functionality Characteristics:- Advanced features
- Complex configuration
- Specific use cases
transposedGridRollup- Financial rollupsexceptions- Exception trackingworkspaceDataGrid- Cross-workspace views
Card Metadata
Component Metadata Structure
Metadata Properties
label
- Display name shown in card selector/documentation
- Should be human-readable and concise
description
- Explains the card’s purpose
- Shown in tooltips and documentation
supportsChildren
trueif card can contain child cardsfalsefor leaf cards
defaultWidth / defaultHeight
- Suggested dimensions in grid units
- Used when adding new cards in editor
options
- Array of configurable properties
- Each option defines a property that can be set in YAML
Card Properties
Common Properties
All cards have access to:Type-Safe Properties
Each card component should define its props interface:Card Communication
Parent → Child (Props)
Data flows down through props:Child → Parent (Events)
Events bubble up:Shared State (Store)
Cards access shared state through Pinia stores:Creating New Cards
1. Create Vue Component
2. Create Metadata File
3. Test the Card
4. Document the Card
Create documentation following the card documentation template.Best Practices
1. Single Responsibility
Each card should do one thing well:Good Examples:
label- Shows textdataStoreGrid- Shows grid data
megaCard- Shows grid, tree, and form all in one
2. Composability
Design cards to work together:3. Configuration Over Code
Use properties instead of hardcoding:4. Consistent Naming
Follow the naming convention:- File:
kodexa-form-card-{name}.vue - Type:
{camelCaseName} - Metadata:
kodexa-form-card-{name}.ts - Docs:
{name}.md
