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-clean.html
View on GitHub<!DOCTYPE html>
<html data-theme="dark">
<head>
<style>
/* ===== THEME VARIABLES ===== */
/* Replace these values with your chosen design style */
:root {
/* Light mode defaults */
--color-bg-primary: #F2F2F7;
--color-bg-secondary: #FFFFFF;
--color-surface: rgba(255, 255, 255, 0.72);
--color-accent: #007AFF;
--color-accent-hover: rgba(0, 122, 255, 0.85);
--color-accent-container: rgba(0, 122, 255, 0.12);
--color-success: #34C759;
--color-danger: #FF3B30;
--color-text-primary: #000000;
--color-text-secondary: rgba(60, 60, 67, 0.6);
--color-text-muted: rgba(60, 60, 67, 0.3);
--color-border: rgba(60, 60, 67, 0.12);
--color-fill: rgba(120, 120, 128, 0.12);
--font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
--font-size-xs: 11px;
--font-size-sm: 13px;
--font-size-md: 15px;
--font-size-lg: 17px;
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;
--shadow-sm: 0 0.5px 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.06);
--shadow-md: 0 2px 12px rgba(0,0,0,0.08), 0 0.5px 2px rgba(0,0,0,0.04);
--transition-fast: 150ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
--transition-med: 280ms cubic-bezier(0.4, 0, 0.2, 1);
--blur-amount: 20px;
}
[data-theme="dark"] {
--color-bg-primary: #000000;
--color-bg-secondary: #1C1C1E;
--color-surface: rgba(44, 44, 46, 0.72);
--color-accent: #0A84FF;
--color-accent-hover: rgba(10, 132, 255, 0.85);
--color-accent-container: rgba(10, 132, 255, 0.15);
--color-success: #30D158;
--color-danger: #FF453A;
--color-text-primary: #FFFFFF;
--color-text-secondary: rgba(235, 235, 245, 0.6);
--color-text-muted: rgba(235, 235, 245, 0.3);
--color-border: rgba(84, 84, 88, 0.6);
--color-fill: rgba(120, 120, 128, 0.24);
--shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 0.5px 1px rgba(0,0,0,0.1);
--shadow-md: 0 4px 16px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
}
/* ===== BASE STYLES ===== */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--font-family);
background: var(--color-bg-primary);
color: var(--color-text-primary);
padding: 16px;
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: 16px;
max-width: 400px;
margin: 0 auto;
}
.panel {
background: var(--color-surface);
-webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
backdrop-filter: blur(var(--blur-amount)) saturate(180%);
border-radius: var(--radius-lg);
padding: 16px;
border: 0.5px solid var(--color-border);
box-shadow: var(--shadow-sm);
animation: fadeSlideIn 0.4s ease-out both;
}
.panel:nth-child(2) { animation-delay: 0.05s; }
.panel:nth-child(3) { animation-delay: 0.1s; }
.panel:nth-child(4) { animation-delay: 0.15s; }
.section-label {
font-size: var(--font-size-xs);
font-weight: 600;
text-transform: uppercase;
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: var(--font-size-md);
font-weight: 600;
border: none;
border-radius: var(--radius-md);
cursor: pointer;
transition: all var(--transition-fast);
position: relative;
overflow: hidden;
}
.btn:active {
transform: scale(0.97);
}
.btn-primary {
background: var(--color-accent);
color: #FFFFFF;
box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
opacity: 0.85;
}
.btn-secondary {
background: var(--color-accent-container);
color: var(--color-accent);
}
.btn-secondary:hover {
background: var(--color-fill);
}
.btn-danger {
background: var(--color-danger);
color: #FFFFFF;
}
/* ===== SLIDERS ===== */
.slider-group {
display: flex;
flex-direction: column;
gap: 6px;
}
.slider-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.slider-label {
font-size: var(--font-size-sm);
font-weight: 500;
color: var(--color-text-secondary);
}
.slider-value {
font-size: var(--font-size-sm);
font-weight: 600;
color: var(--color-accent);
font-variant-numeric: tabular-nums;
}
input[type="range"] {
-webkit-appearance: none;
width: 100%;
height: 4px;
border-radius: 2px;
background: var(--color-fill);
outline: none;
cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 28px;
height: 28px;
border-radius: 50%;
background: #FFFFFF;
box-shadow: 0 0.5px 4px rgba(0, 0, 0, 0.12),
0 6px 13px rgba(0, 0, 0, 0.12);
cursor: pointer;
transition: transform var(--transition-fast);
}
input[type="range"]:active::-webkit-slider-thumb {
transform: scale(1.1);
}
input[type="range"]::-moz-range-thumb {
width: 28px;
height: 28px;
border-radius: 50%;
background: #FFFFFF;
border: none;
box-shadow: 0 0.5px 4px rgba(0, 0, 0, 0.12),
0 6px 13px rgba(0, 0, 0, 0.12);
cursor: pointer;
}
/* ===== TOGGLES ===== */
.toggle-group {
display: flex;
align-items: center;
justify-content: space-between;
}
.toggle-label {
font-size: var(--font-size-md);
font-weight: 400;
color: var(--color-text-primary);
}
.toggle {
width: 51px;
height: 31px;
border-radius: 15.5px;
background: var(--color-fill);
position: relative;
cursor: pointer;
transition: background var(--transition-med);
flex-shrink: 0;
}
.toggle.active {
background: var(--color-success);
}
.toggle::after {
content: '';
position: absolute;
width: 27px;
height: 27px;
border-radius: 50%;
background: #FFFFFF;
top: 2px;
left: 2px;
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15),
0 1px 1px rgba(0, 0, 0, 0.06);
transition: transform var(--transition-med);
}
.toggle.active::after {
transform: translateX(20px);
}
/* ===== ANIMATIONS ===== */
@keyframes fadeSlideIn {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* ===== 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;
// Listen for events from MATLAB
htmlComponent.addEventListener("UpdateValues", function(event) {
const data = event.Data;
// Update component values from MATLAB
// Example: if (data.sliderValue !== undefined) { ... }
});
htmlComponent.addEventListener("SetTheme", function(event) {
document.documentElement.setAttribute('data-theme', event.Data.theme);
});
// Send initial state to MATLAB
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;
// Update displayed 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">
<!-- Example: 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>
<!-- Example: 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>
<!-- Example: 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 (for testing) -->
<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 active" onclick="toggleTheme()" tabindex="0" role="switch" onkeydown="handleToggleKey(event)" aria-checked="true"></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 |