std-loading
Level: Atom | Entity: LoadableItem | Persistence: runtime
4 states, 5 events, 7 transitions
Live Preview
orbital LoadableItemOrbital {
entity LoadableItem [runtime] {
id : string
name : string
description : string
status : string
createdAt : string
loadingStatus : string
}
trait LoadableItemLoading -> LoadableItem [interaction] {
initial: idle
state idle {
INIT -> idle
(set @entity.loadingStatus idle)
(render-ui main { type: "center", children: [{ type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "play-circle", size: "lg" }, { type: "typography", content: "LoadableItem", variant: "h2" }] }, { type: "divider" }, { type: "typography", variant: "body", color: "muted", content: "Ready to load loadableitem. Click Start to begin." }, { type: "button", label: "Start", event: "START", variant: "primary", icon: "play" }] }] })
START -> loading
(set @entity.loadingStatus loading)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "loading-state", title: "Loading", message: "Loading loadableitem..." }, { type: "spinner", size: "lg" }, { type: "progress-bar", value: 50, showPercentage: true }, { type: "skeleton", variant: "text" }] })
}
state loading {
LOADED -> success
(set @entity.loadingStatus success)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "md", align: "center", children: [{ type: "icon", name: "check-circle", size: "lg" }, { type: "typography", content: "Success", variant: "h2" }] }, { type: "divider" }, { type: "alert", variant: "success", message: "Operation completed successfully." }, { type: "button", label: "Reset", event: "RESET", variant: "ghost", icon: "rotate-ccw" }] })
FAILED -> error
(set @entity.loadingStatus error)
(render-ui main { type: "error-boundary", children: [{ type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "error-state", title: "Error", message: "Something went wrong. Please try again.", onRetry: "START" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "center", children: [{ type: "button", label: "Retry", event: "START", variant: "primary", icon: "rotate-ccw" }, { type: "button", label: "Reset", event: "RESET", variant: "ghost" }] }] }] })
}
state success {
RESET -> idle
(set @entity.loadingStatus idle)
(render-ui main { type: "center", children: [{ type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "play-circle", size: "lg" }, { type: "typography", content: "LoadableItem", variant: "h2" }] }, { type: "divider" }, { type: "typography", variant: "body", color: "muted", content: "Ready to load loadableitem. Click Start to begin." }, { type: "button", label: "Start", event: "START", variant: "primary", icon: "play" }] }] })
}
state error {
START -> loading
(set @entity.loadingStatus loading)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "loading-state", title: "Loading", message: "Loading loadableitem..." }, { type: "spinner", size: "lg" }, { type: "progress-bar", value: 50, showPercentage: true }, { type: "skeleton", variant: "text" }] })
RESET -> idle
(set @entity.loadingStatus idle)
(render-ui main { type: "center", children: [{ type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "play-circle", size: "lg" }, { type: "typography", content: "LoadableItem", variant: "h2" }] }, { type: "divider" }, { type: "typography", variant: "body", color: "muted", content: "Ready to load loadableitem. Click Start to begin." }, { type: "button", label: "Start", event: "START", variant: "primary", icon: "play" }] }] })
}
}
page "/loadableitems/loading" -> LoadableItemLoading
}
Loading preview...
Orbital Visualization
Loading visualization...
Entity Fields
| Field | Type | Default |
|---|---|---|
| id | string | - |
| name | string | - |
| description | string | - |
| status | string | "active" |
| createdAt | string | - |
| loadingStatus | string | "idle" |
States
| State | Type |
|---|---|
| idle | Initial |
| loading | - |
| success | - |
| error | - |
Events
| Event | Payload |
|---|---|
| INIT | - |
| START | - |
| LOADED | - |
| FAILED | - |
| RESET | - |
Transitions
| From | Event | To | Effects |
|---|---|---|---|
| idle | INIT | idle | 2 effects |
| idle | START | loading | 2 effects |
| loading | LOADED | success | 2 effects |
| loading | FAILED | error | 2 effects |
| error | START | loading | 2 effects |
| error | RESET | idle | 2 effects |
| success | RESET | idle | 2 effects |