reference
labkit.app.Definition
Compile and launch one immutable App SDK contract.
Syntax
app = labkit.app.Definition(Entrypoint=entrypoint, AppId=appId, ...
Title=title, ...
Family=family, AppVersion=version, Updated=date, ...
Requirements=requirements, Workbench=workbench, Name=Value)
fig = app.launch()
fig = app.launch(InitialProject=project)
fig = app.launch(Diagnostics=diagnosticOptions)
requirements = app.launch("requirements")
version = app.launch("version")Description
Definition validates product metadata, layout-owned callbacks and renderers, global IDs, callback roles, and references in one atomic constructor. The static target graph is cached once. validateViewSnapshot checks a complete view snapshot against that graph without rebuilding the layout.
Required Name-Value Arguments
Entrypoint- Public MATLAB launch function name as a scalar identifier.
AppId- Stable App identifier beginning with an ASCII letter and containing letters, digits, underscore, hyphen, or period.
Title- Nonempty reader-facing scalar text.
Family- Nonempty reader-facing scalar text.
AppVersion- Semantic version in X.Y.Z form.
Updated- Product date in YYYY-MM-DD form.
Requirements- Empty value or
labkit.contract.requirementsresult. Workbench- Root value returned by
labkit.app.layout.workbench.
Optional Name-Value Arguments
DisplayName- Nonempty scalar text. Default: Title.
ProjectSchemalabkit.app.project.Schemaor empty for a static App. Default: empty.CreateSession- Fixed callback session = callback(project,context). Portable project sources remain opaque; use context.resolveSourcePaths while rebuilding transient session data. Default: empty.
PresentWorkbench- Fixed callback view = callback(state). Default: empty.
OnStart- Fixed callback state = callback(state,context), invoked after the first view commit. Default: empty.
BuildDebugSample- Fixed callback pack = callback(context). Default: empty.
Outputs
app- Immutable compiled labkit.app.Definition value.
Definition Methods
launch()- Build and show the native MATLAB App figure.
launch(Diagnostics=options)- Use one
labkit.app.diagnostic.Optionsvalue for standard or verbose sanitized runtime recording. launch("requirements")- Return declared facade requirements without creating a figure.
launch("version")- Return product version metadata without creating a figure.
validateViewSnapshot(view)- Validate target references, target capabilities and complete target coverage. Returns true or throws before any runtime UI mutation.
Errors
labkit:app:contract:UnknownArgument- A required argument is missing or an argument is unknown, duplicated, or unpaired.
labkit:app:contract:InvalidValue- Metadata, requirements, workbench, callbacks, or renderers are malformed.
labkit:app:contract:DuplicateId- A layout ID is duplicated.
labkit:app:contract:UnknownReference- A view target is undeclared.
labkit:app:contract:UnsupportedOperation- A view operation is not legal for its target.
labkit:app:contract:InvalidValue- A launch request or output count is unsupported.
Typical Call
workbench = labkit.app.layout.workbench({ ...
labkit.app.layout.button("run", "Run", @runAnalysis, ...
Tooltip="Compute the current analysis.")});
app = labkit.app.Definition( ...
Entrypoint="labkit_Example_app", AppId="example.app", ...
Title="Example", Family="Examples", AppVersion="1.0.0", ...
Updated="2026-07-19", Requirements=[], Workbench=workbench);Related APIs
labkit.app.layout.workbench— Assemble controls and a central workspace into the root layout.labkit.app.view.Snapshot— Build one immutable complete visible-state snapshot.labkit.contract.requirements— Describe the LabKit API versions required by a caller.labkit.app.CallbackContext— Provide declared App-neutral runtime capabilities.labkit.app.diagnostic.Artifact— Describe one anonymous diagnostic-sample artifact.labkit.app.diagnostic.Options— Configure one App SDK diagnostic session.labkit.app.diagnostic.SampleContext— Provide bounded folders for anonymous debug samples.labkit.app.diagnostic.SamplePack— Describe one typed anonymous App reproduction scenario.
Source
This page is generated from the MATLAB help text in +labkit/+app/Definition.m.