matlab/agent-skills-playground / skills/matlab-uihtml-design
matlab-uihtml-design
VerifiedGenerate beautiful, distinctive HTML/CSS/JS control panels for MATLAB uihtml components. 8 built-in styles (Clean, Material, Cosmic Dark, Neumorphic Dark, Dashboard Light, Midnight Gradient, Minimal Mono, Warm Dark) plus custom aesthetics. Produces production-grade UI with sliders, buttons, toggles, and panels. Use when building visually polished MATLAB app UIs with uihtml.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 19.6 KB |
| assets/base-template-clean.html | other | 14.4 KB |
| assets/base-template-cosmic-dark.html | other | 15.1 KB |
| assets/base-template-dashboard-light.html | other | 12.8 KB |
| assets/base-template-material.html | other | 15.2 KB |
| assets/base-template-midnight-gradient.html | other | 13.8 KB |
| assets/base-template-minimal-mono.html | other | 12.5 KB |
| assets/base-template-neumorphic-dark.html | other | 13.2 KB |
| assets/base-template-warm-dark.html | other | 13.3 KB |
| assets/style-gallery.html | other | 33.1 KB |
| references/design-styles.md | markdown | 2.6 KB |
| references/styles/clean.md | markdown | 8.8 KB |
| references/styles/cosmic-dark.md | markdown | 10.1 KB |
| references/styles/dashboard-light.md | markdown | 8.5 KB |
| references/styles/material.md | markdown | 9.7 KB |
| references/styles/midnight-gradient.md | markdown | 9.5 KB |
| references/styles/minimal-mono.md | markdown | 8.5 KB |
| references/styles/neumorphic-dark.md | markdown | 10.4 KB |
| references/styles/warm-dark.md | markdown | 9.2 KB |
assets/base-template-dashboard-light.html
View on GitHub<!DOCTYPE html>
<html data-theme="light">
<head>
<style>
/* ===== THEME VARIABLES — Dashboard Light ===== */
:root {
/* Light mode (default for this style) */
--color-bg: #f0f0f8;
--color-surface: #FFFFFF;
--color-primary: #4338ca;
--color-primary-light: #e0e7ff;
--color-on-primary: #FFFFFF;
--color-success: #16a34a;
--color-danger: #dc2626;
--color-text-primary: #1e1b4b;
--color-text-secondary: #64748b;
--color-text-muted: #94a3b8;
--color-border: #e2e8f0;
--color-border-subtle: #f1f5f9;
--font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
--radius-card: 12px;
--radius-btn: 8px;
--radius-pill: 9999px;
--shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
--transition-standard: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] {
--color-bg: #0f172a;
--color-surface: #1e293b;
--color-primary: #818cf8;
--color-primary-light: rgba(129, 140, 248, 0.15);
--color-on-primary: #FFFFFF;
--color-success: #4ade80;
--color-danger: #f87171;
--color-text-primary: #f1f5f9;
--color-text-secondary: #94a3b8;
--color-text-muted: #475569;
--color-border: #334155;
--color-border-subtle: #1e293b;
--shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
}
/* ===== BASE STYLES ===== */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--font-family);
background: var(--color-bg);
color: var(--color-text-primary);
padding: 20px;
height: 100vh;
overflow-y: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
background: var(--color-border);
border-radius: 2px;
}
/* ===== LAYOUT ===== */
.controls-container {
display: flex;
flex-direction: column;
gap: 12px;
max-width: 400px;
margin: 0 auto;
}
.panel {
background: var(--color-surface);
border-radius: var(--radius-card);
padding: 20px;
border: 1px solid var(--color-border);
box-shadow: var(--shadow-card);
animation: fadeIn 0.3s ease-out both;
}
.panel:nth-child(2) { animation-delay: 0.03s; }
.panel:nth-child(3) { animation-delay: 0.06s; }
.panel:nth-child(4) { animation-delay: 0.09s; }
.section-label {
font-size: 11px;
font-weight: 500;
letter-spacing: 0.5px;
color: var(--color-text-secondary);
margin-bottom: 12px;
}
/* ===== BUTTONS ===== */
.button-group {
display: flex;
gap: 8px;
}
.btn {
padding: 10px 20px;
font-size: 14px;
font-weight: 500;
letter-spacing: 0.1px;
border: none;
border-radius: var(--radius-btn);
cursor: pointer;
transition: all var(--transition-standard);
}
.btn:active {
transform: scale(0.98);
}
.btn-primary {
background: var(--color-primary);
color: var(--color-on-primary);
box-shadow: 0 1px 3px rgba(67, 56, 202, 0.2);
}
.btn-primary:hover {
box-shadow: 0 2px 8px rgba(67, 56, 202, 0.3);
}
.btn-secondary {
background: transparent;
color: var(--color-primary);
border: 1.5px solid var(--color-primary);
}
.btn-secondary:hover {
background: rgba(67, 56, 202, 0.05);
}
/* ===== SLIDERS ===== */
.slider-group {
display: flex;
flex-direction: column;
gap: 8px;
}
.slider-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.slider-label {
font-size: 14px;
font-weight: 400;
color: var(--color-text-secondary);
letter-spacing: 0.25px;
}
.slider-value {
font-size: 14px;
font-weight: 500;
color: var(--color-primary);
font-variant-numeric: tabular-nums;
}
input[type="range"] {
-webkit-appearance: none;
width: 100%;
height: 6px;
border-radius: 3px;
background: var(--color-border);
outline: none;
cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--color-primary);
cursor: pointer;
box-shadow: 0 2px 6px rgba(67, 56, 202, 0.3);
transition: transform 150ms ease;
}
input[type="range"]:active::-webkit-slider-thumb {
transform: scale(1.15);
}
input[type="range"]::-moz-range-thumb {
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--color-primary);
border: none;
box-shadow: 0 2px 6px rgba(67, 56, 202, 0.3);
}
/* ===== TOGGLES ===== */
.toggle-group {
display: flex;
align-items: center;
justify-content: space-between;
}
.toggle-label {
font-size: 14px;
font-weight: 400;
color: var(--color-text-primary);
letter-spacing: 0.25px;
}
.toggle {
width: 44px;
height: 24px;
border-radius: 12px;
background: var(--color-border);
position: relative;
cursor: pointer;
transition: background 250ms ease;
flex-shrink: 0;
}
.toggle.active {
background: var(--color-primary);
}
.toggle::after {
content: '';
position: absolute;
width: 20px;
height: 20px;
border-radius: 50%;
background: #FFFFFF;
top: 2px;
left: 2px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle.active::after {
transform: translateX(20px);
}
/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
/* ===== FOCUS-VISIBLE (keyboard) — uihtml design guardrails ===== */
.btn:focus-visible,
.toggle:focus-visible {
outline: 2px solid var(--color-accent, var(--accent-secondary, var(--color-primary, var(--md-primary, Highlight))));
outline-offset: 2px;
}
input[type="range"]:focus-visible::-webkit-slider-thumb {
box-shadow: 0 0 0 3px var(--color-accent, var(--accent-secondary, var(--color-primary, var(--md-primary, Highlight))));
}
input[type="range"]:focus-visible::-moz-range-thumb {
box-shadow: 0 0 0 3px var(--color-accent, var(--accent-secondary, var(--color-primary, var(--md-primary, Highlight))));
}
/* ===== REDUCED MOTION — uihtml design guardrails ===== */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
</style>
<script type="text/javascript">
// ===== MATLAB UIHTML INTEGRATION =====
function handleToggleKey(event) {
if (event.key === ' ' || event.key === 'Enter') {
event.preventDefault();
event.currentTarget.click();
}
}
function setup(htmlComponent) {
window.htmlComponent = htmlComponent;
htmlComponent.addEventListener("UpdateValues", function(event) {
const data = event.Data;
});
htmlComponent.addEventListener("SetTheme", function(event) {
document.documentElement.setAttribute('data-theme', event.Data.theme);
});
sendState();
}
// ===== STATE MANAGEMENT =====
let state = {
slider1: 50,
toggle1: false
};
function sendState() {
if (window.htmlComponent) {
window.htmlComponent.sendEventToMATLAB("StateChange", state);
}
}
// ===== COMPONENT HANDLERS =====
function onSliderChange(name, value) {
value = parseFloat(value);
state[name] = value;
const display = document.getElementById(name + "Value");
if (display) {
display.textContent = value.toFixed(1);
}
if (window.htmlComponent) {
window.htmlComponent.sendEventToMATLAB("SliderChange", {
control: name,
value: value
});
}
}
function onToggle(name) {
state[name] = !state[name];
const el = document.getElementById(name);
el.classList.toggle('active');
el.setAttribute('aria-checked', el.classList.contains('active'));
if (window.htmlComponent) {
window.htmlComponent.sendEventToMATLAB("ToggleChange", {
control: name,
value: state[name]
});
}
}
function onButtonClick(action) {
if (window.htmlComponent) {
window.htmlComponent.sendEventToMATLAB("ButtonClick", {
action: action
});
}
}
// ===== THEME TOGGLE =====
function toggleTheme() {
const html = document.documentElement;
const current = html.getAttribute('data-theme');
const next = current === 'dark' ? 'light' : 'dark';
html.setAttribute('data-theme', next);
document.getElementById('themeToggle').setAttribute('aria-checked', next === 'dark');
if (window.htmlComponent) {
window.htmlComponent.sendEventToMATLAB("ThemeChange", { theme: next });
}
}
</script>
</head>
<body>
<div class="controls-container">
<!-- Buttons Panel -->
<div class="panel">
<div class="section-label">Actions</div>
<div class="button-group">
<button class="btn btn-primary" onclick="onButtonClick('play')">Play</button>
<button class="btn btn-secondary" onclick="onButtonClick('reset')">Reset</button>
</div>
</div>
<!-- Slider Panel -->
<div class="panel">
<div class="section-label">Parameters</div>
<div class="slider-group">
<div class="slider-header">
<span class="slider-label">Speed</span>
<span id="slider1Value" class="slider-value">50.0</span>
</div>
<input type="range" id="slider1" min="0" max="100" step="0.1" value="50"
oninput="onSliderChange('slider1', this.value)">
</div>
</div>
<!-- Toggle Panel -->
<div class="panel">
<div class="section-label">Options</div>
<div class="toggle-group">
<span class="toggle-label">Auto-rotate</span>
<div id="toggle1" class="toggle" onclick="onToggle('toggle1')" tabindex="0" role="switch" onkeydown="handleToggleKey(event)" aria-checked="false"></div>
</div>
</div>
<!-- Theme Toggle -->
<div class="panel">
<div class="section-label">Appearance</div>
<div class="toggle-group">
<span class="toggle-label">Dark Mode</span>
<div id="themeToggle" class="toggle" onclick="toggleTheme()" tabindex="0" role="switch" onkeydown="handleToggleKey(event)" aria-checked="false"></div>
</div>
</div>
</div>
</body>
</html>
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |