Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/matlab-app-building/matlab-build-app

matlab-build-app

Unverified

Build MATLAB apps from requirements to working code. Asks discovery questions (or skips them when the path is known), recommends UIFigure or UIHTML architecture, identifies layout archetype (Dashboard, Explorer, Tabbed, Wizard, Canvas), produces an implementation plan, and executes the build. For UIFigure apps, optionally serializes as App Designer (.mlapp or plain-text .m + .xml). Use when a user wants to build a MATLAB app, create a GUI, make an interactive tool, build a uifigure app, build a uihtml app, build an App Designer app, build a .mlapp app, build a plain-text App Designer app, or asks which approach to use. Also use when user describes spatial layout needs: dashboard, control panel, sidebar, tabs, wizard, stepper, canvas, workspace.

FileKindSize
SKILL.mdskill md20.9 KB
assets/colors_and_type.cssother12.8 KB
assets/minimal-bridge.htmlother1.3 KB
assets/minimal-bridge.mother1.2 KB
assets/standalone-chart-template.htmlother11.5 KB
manifest.yamlconfig672 B
references/app-designer/agent-guide-mlapp.mdmarkdown15.7 KB
references/app-designer/agent-guide-plaintext.mdmarkdown14.7 KB
references/app-designer/agent-guide-shared.mdmarkdown27.1 KB
references/app-designer/background-tasks.mdmarkdown4.8 KB
references/app-designer/plaintext/classdef-template.mdmarkdown11.3 KB
references/app-designer/plaintext/matlabAppSchema.xsdother16.8 KB
references/app-designer/plaintext/property-reference.mdmarkdown45.1 KB
references/app-designer/plaintext/xml-template.mdmarkdown12.3 KB
references/archetypes/canvas.mdmarkdown8.0 KB
references/archetypes/dashboard.mdmarkdown6.4 KB
references/archetypes/explorer.mdmarkdown5.7 KB
references/archetypes/tabbed.mdmarkdown6.6 KB
references/archetypes/wizard.mdmarkdown9.7 KB
references/background-tasks.mdmarkdown6.9 KB
references/editing-guide.mdmarkdown3.3 KB
references/timers.mdmarkdown2.1 KB
references/uifigure/callbacks.mdmarkdown3.0 KB
references/uifigure/components.mdmarkdown1.7 KB
references/uifigure/containers.mdmarkdown1.3 KB
references/uifigure/grid-layout.mdmarkdown4.9 KB
references/uifigure/guide.mdmarkdown5.3 KB
references/uifigure/layout-patterns.mdmarkdown1.5 KB
references/uifigure/mvvm-background-tasks.mdmarkdown3.9 KB
references/uifigure/mvvm-guide.mdmarkdown11.1 KB
references/uifigure/mvvm-testing.mdmarkdown2.8 KB
references/uifigure/mvvm-view-binding.mdmarkdown5.4 KB
references/uihtml/brand-design-tokens.mdmarkdown5.6 KB
references/uihtml/bridge-guide.mdmarkdown7.0 KB
references/uihtml/chart-bridge-integration.mdmarkdown7.5 KB
references/uihtml/chart-performance.mdmarkdown5.0 KB
references/uihtml/chart-type-selection.mdmarkdown3.1 KB
references/uihtml/chart-updates.mdmarkdown4.7 KB
references/uihtml/charting-guide.mdmarkdown3.9 KB
references/uihtml/chartjs-setup.mdmarkdown4.0 KB
references/uihtml/communication-patterns.mdmarkdown4.2 KB
references/uihtml/component-styles.mdmarkdown4.3 KB
references/uihtml/css-layout-patterns.mdmarkdown5.0 KB
references/uihtml/dark-mode.mdmarkdown3.8 KB
references/uihtml/data-types.mdmarkdown2.7 KB
references/uihtml/doughnut-scatter-charts.mdmarkdown6.0 KB
references/uihtml/error-handling.mdmarkdown4.6 KB
references/uihtml/external-color-schemes.mdmarkdown2.6 KB
references/uihtml/js-coding-guide.mdmarkdown11.2 KB
references/uihtml/js-testing-debugging.mdmarkdown2.9 KB
references/uihtml/line-bar-charts.mdmarkdown5.2 KB
references/uihtml/mvvm-guide.mdmarkdown11.0 KB
references/uihtml/mvvm-observable-classes.mdmarkdown2.9 KB
references/uihtml/mvvm-view-binding.mdmarkdown5.3 KB
references/uihtml/platform-limitations.mdmarkdown2.5 KB
references/uihtml/setup.mdmarkdown3.9 KB
references/uihtml/styling-guide.mdmarkdown8.1 KB
scripts/+module/+backgroundtask/BackgroundTaskModule.pbinary2.5 KB
scripts/+module/+backgroundtask/templates/cancelBackground.mother357 B
scripts/+module/+backgroundtask/templates/handleBackgroundComplete.mother1.4 KB
scripts/+module/+backgroundtask/templates/safeProgress.mother734 B
scripts/+module/+backgroundtask/templates/startBackground.mother1.2 KB
scripts/+module/AppBuilderModule.pbinary242 B
scripts/AppDesignerAgentInterface.pbinary12.6 KB
scripts/MlappBackend.pbinary9.4 KB
scripts/PlainTextBackend.pbinary10.2 KB

references/uihtml/styling-guide.md

View on GitHub
# UIHTML Styling

Apply professional styling and theming to web frontends used in MATLAB uihtml apps. Covers CSS layout, color, typography, spacing, responsive design, branding, and visual feedback.

## Critical Rules

- MUST use CSS custom properties (variables) for all theme values — never hardcode colors/fonts inline
- MUST use CSS Grid or Flexbox for layout — never use absolute positioning for app structure
- MUST provide visual feedback for all interactive elements (hover, active, disabled states)
- MUST include `box-sizing: border-box` globally
- MUST use `margin: 0` on `<body>` for uihtml apps — the uifigure controls outer spacing
- NEVER use fixed pixel widths for the main layout — the uihtml component may resize
- NEVER link to CDN resources for fonts — uihtml cannot access external URLs; use local font files
- Use semantic tokens (`--color-text-primary`, `--bg-primary`, etc.) in component styles — never reference raw palette values directly in UI code

## Foundation: CSS Reset

Every uihtml HTML file should start with this minimal reset:

```css
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
}
```

The `margin: 0` is critical for uihtml — the uifigure grid layout already controls spacing around the component.

## Design Tokens

Define all visual values as CSS custom properties on `:root`. This enables theming, consistency, and easy updates.

```css
:root {
    /* Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-elevated: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #0072BD;           /* MATLAB default blue */
    --accent-hover: #005a9e;
    --accent-light: rgba(0, 114, 189, 0.1);
    --error: #d32f2f;
    --success: #2e7d32;
    --border: #e0e0e0;

    /* Typography */
    --font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Consolas', 'Monaco', monospace;
    --font-size-sm: 0.8125rem;   /* 13px */
    --font-size-base: 0.875rem;  /* 14px */
    --font-size-lg: 1rem;        /* 16px */
    --font-size-xl: 1.25rem;     /* 20px */

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Shape */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}
```

## Dark Mode

Override token values using a class toggle on `body`. Do not use `:root.dark` — class changes on `<html>` do not trigger CSS repaints in MATLAB's embedded webview.

```css
body.dark {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-elevated: #333333;
    --text-primary: #e0e0e0;
    --text-secondary: #999999;
    --accent: #4dabf7;
    --accent-hover: #74c0fc;
    --accent-light: rgba(77, 171, 247, 0.15);
    --border: #444444;
}
```

Toggle from JavaScript:

```javascript
document.body.classList.toggle('dark');
```

See `dark-mode.md` for complete dark mode token sets (generic and branded themes) and media query alternatives.

## Layout Patterns

### Full-Page App Layout (CSS Grid)

The standard layout for a uihtml app that fills its container:

```css
.app-layout {
    display: grid;
    grid-template-rows: auto 1fr auto;  /* header, main, footer */
    height: 100vh;
    width: 100%;
}

.app-header {
    padding: var(--space-md);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.app-main {
    padding: var(--space-md);
    overflow-y: auto;
}

.app-footer {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}
```

### Additional Patterns

| Pattern | Use case |
|---------|----------|
| Full-page | Standard uihtml app filling container |
| Sidebar + content | Explorer-style control panel |
| Control panel (Flexbox) | Groups of sliders/dropdowns |
| Card grid | Dashboard panels |

See `css-layout-patterns.md` for complete CSS for all patterns.

## Professional Branding

For professionally branded UIs, use a two-layer token architecture:

1. **Raw palette** (`--c-*`) — named colors at specific shades (defined in the asset file)
2. **Semantic tokens** (`--color-*`, `--bg-*`, `--border-*`) — colors assigned to UI roles (used in component styles)

Copy `assets/colors_and_type.css` into your project and link it first:

```html
<link rel="stylesheet" href="colors_and_type.css">
```

**Typography:** Source Sans 3 (`--font-sans`) for UI text, Source Code Pro (`--font-mono`) for code. For uihtml: download font files locally since CDN access is blocked.

**Graphics/chart colors:** `--c-graphics-1` through `--c-graphics-7` match MATLAB's default `colororder`, ensuring web charts stay consistent with MATLAB figures.

For cross-path token alignment with MATLAB's theme struct, see `matlab-apply-theme`.

## Responsive Design

The uihtml component resizes with its parent uifigure or grid layout cell. Use relative units and media queries to adapt:

```css
/* Respond to narrow widths (small uihtml panel) */
@media (max-width: 500px) {
    .control-panel {
        flex-direction: column;
    }

    .sidebar-layout {
        grid-template-columns: 1fr;
    }
}

/* Use relative units instead of fixed pixels */
.container {
    padding: clamp(8px, 2vw, 24px);
    font-size: clamp(12px, 1.5vw, 16px);
}
```

## Implementation Checklist

- [ ] CSS custom properties defined for all theme values (colors, spacing, typography)
- [ ] `box-sizing: border-box` applied globally
- [ ] `body { margin: 0 }` set for uihtml apps
- [ ] Layout uses CSS Grid or Flexbox (no absolute positioning for structure)
- [ ] All interactive elements have hover, active, and disabled states
- [ ] Loading indicator implemented for MATLAB computation waits
- [ ] Error/success status messages styled
- [ ] Responsive behavior tested at different uihtml component sizes
- [ ] Consistent with MATLAB color palette where appropriate
- [ ] Dark mode supported via CSS custom property overrides (if required)
- [ ] For branded UIs: `colors_and_type.css` linked first, semantic tokens used throughout
- [ ] Text on light backgrounds uses palette values 600+ (AA contrast)
- [ ] Text on dark backgrounds uses palette values 500 or lighter (AA contrast)
- [ ] No emoji in product UI copy

## Troubleshooting

| Issue | Cause | Solution |
|-------|-------|----------|
| Content overflows uihtml bounds | Fixed pixel dimensions | Use `100%`, `100vh`, or relative units |
| Gap between uihtml and figure edge | Body margin | Set `body { margin: 0 }` |
| Fonts look different across platforms | No font stack | Use `system-ui, -apple-system, 'Segoe UI', sans-serif` |
| Colors inconsistent across components | Hardcoded hex values | Use CSS custom properties everywhere |
| Hover effects missing on touch | CSS `:hover` only | Add `:active` states as fallback |
| Layout breaks when panel resizes | Fixed widths | Use `flex: 1`, `minmax()`, or `clamp()` |
| Fonts not loading in uihtml | CDN blocked | Download font files locally, use `@font-face` |
| Brand tokens not applying | Missing asset link | Ensure `colors_and_type.css` is linked before other stylesheets |

## References

| Topic | File | Description |
|-------|------|-------------|
| Component styles | `component-styles.md` | Buttons, form inputs, range sliders, data tables CSS |
| Layout patterns | `css-layout-patterns.md` | Full-page, sidebar, control panel, card grid complete CSS |
| Brand design tokens | `brand-design-tokens.md` | Full semantic token set, typography scale, spacing, shadows, component tokens |
| Dark mode | `dark-mode.md` | Complete dark mode overrides for generic and branded themes |
| External color schemes | `external-color-schemes.md` | Importing Material Design, Adobe Color, Tailwind palettes into CSS tokens |

----

Copyright 2026 The MathWorks, Inc.

----
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 321kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 197kUpdated Claude CodeCodexVerifiedInstall