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-cosmic-dark.html
View on GitHub<!DOCTYPE html>
<html data-theme="dark">
<head>
<style>
/* ===== THEME VARIABLES — Cosmic Dark ===== */
:root {
/* Light mode (adapted) */
--bg-deep: #f0f0f8;
--bg-mid: #e8e8f4;
--glass-bg: rgba(255, 255, 255, 0.8);
--glass-bg-hover: rgba(255, 255, 255, 0.9);
--glass-border: rgba(0, 0, 0, 0.08);
--glass-highlight: rgba(255, 255, 255, 0.9);
--accent-primary: #5b4cc4;
--accent-secondary: #7c6cf0;
--accent-glow: rgba(91, 76, 196, 0.2);
--accent-glow-strong: rgba(91, 76, 196, 0.35);
--danger: #e0459b;
--danger-glow: rgba(224, 69, 155, 0.2);
--text-primary: #1a1a2e;
--text-secondary: #4a4e68;
--text-muted: #8b8fa8;
--font-family: 'Segoe UI', 'SF Pro Display', -apple-system, system-ui, sans-serif;
--radius-sm: 8px;
--radius-md: 14px;
--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
--transition-med: 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] {
--bg-deep: #0a0a18;
--bg-mid: #10102a;
--glass-bg: rgba(255, 255, 255, 0.03);
--glass-bg-hover: rgba(255, 255, 255, 0.05);
--glass-border: rgba(255, 255, 255, 0.07);
--glass-highlight: rgba(255, 255, 255, 0.06);
--accent-primary: #7c6cf0;
--accent-secondary: #a78bfa;
--accent-glow: rgba(124, 108, 240, 0.35);
--accent-glow-strong: rgba(124, 108, 240, 0.55);
--danger: #f472b6;
--danger-glow: rgba(244, 114, 182, 0.35);
--text-primary: #e8e8f0;
--text-secondary: #8b8fa8;
--text-muted: #5a5e78;
}
/* ===== BASE STYLES ===== */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--font-family);
background:
radial-gradient(ellipse at 20% 0%, rgba(60, 40, 120, 0.15) 0%, transparent 60%),
radial-gradient(ellipse at 80% 100%, rgba(30, 50, 100, 0.12) 0%, transparent 60%),
linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
color: var(--text-primary);
padding: 14px;
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(--glass-border);
border-radius: 2px;
}
/* ===== LAYOUT ===== */
.controls-container {
display: flex;
flex-direction: column;
gap: 16px;
max-width: 400px;
margin: 0 auto;
}
.panel {
background: var(--glass-bg);
-webkit-backdrop-filter: blur(12px);
backdrop-filter: blur(12px);
border-radius: var(--radius-md);
padding: 16px 18px;
border: 1px solid var(--glass-border);
box-shadow:
inset 0 1px 0 var(--glass-highlight),
0 4px 24px rgba(0, 0, 0, 0.3),
0 0 1px rgba(255, 255, 255, 0.05);
animation: fadeSlideIn 0.4s ease-out both;
}
.panel:hover {
background: var(--glass-bg-hover);
}
.panel:nth-child(2) { animation-delay: 0.1s; }
.panel:nth-child(3) { animation-delay: 0.2s; }
.panel:nth-child(4) { animation-delay: 0.3s; }
.section-label {
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 3px;
color: var(--text-secondary);
margin-bottom: 14px;
}
/* ===== BUTTONS ===== */
.button-group {
display: flex;
gap: 8px;
}
.btn {
padding: 9px 18px;
font-size: 13px;
font-weight: 600;
letter-spacing: 0.5px;
border: none;
border-radius: var(--radius-sm);
cursor: pointer;
transition: all var(--transition-med);
position: relative;
overflow: hidden;
}
.btn:active {
transform: scale(0.97);
}
.btn-primary {
background: var(--accent-primary);
color: white;
box-shadow: 0 0 16px var(--accent-glow), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.btn-primary:hover {
background: var(--accent-secondary);
box-shadow: 0 0 24px var(--accent-glow-strong), 0 2px 12px rgba(0, 0, 0, 0.4);
transform: scale(1.03);
}
.btn-secondary {
background: transparent;
color: var(--text-secondary);
border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
background: rgba(255, 255, 255, 0.06);
border-color: rgba(255, 255, 255, 0.15);
color: var(--text-primary);
transform: scale(1.03);
}
.btn-danger {
background: var(--danger);
color: white;
box-shadow: 0 0 16px var(--danger-glow), 0 2px 8px rgba(0, 0, 0, 0.3);
animation: subtlePulse 2s ease-in-out infinite;
}
@keyframes subtlePulse {
0%, 100% { box-shadow: 0 0 12px var(--danger-glow); }
50% { box-shadow: 0 0 22px rgba(244, 114, 182, 0.5); }
}
/* ===== 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: 11px;
font-weight: 500;
color: var(--text-secondary);
}
.slider-value {
font-size: 11px;
font-weight: 700;
color: var(--accent-secondary);
font-variant-numeric: tabular-nums;
}
input[type="range"] {
-webkit-appearance: none;
width: 100%;
height: 4px;
border-radius: 2px;
background: var(--bg-deep);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
outline: none;
cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 14px;
height: 14px;
border-radius: 50%;
background: radial-gradient(circle at 40% 40%, var(--accent-secondary) 0%, var(--accent-primary) 100%);
box-shadow: 0 0 8px var(--accent-glow), 0 2px 4px rgba(0, 0, 0, 0.3);
cursor: pointer;
transition: all var(--transition-fast);
}
input[type="range"]:hover::-webkit-slider-thumb {
transform: scale(1.2);
box-shadow: 0 0 14px var(--accent-glow-strong);
}
input[type="range"]:active::-webkit-slider-thumb {
transform: scale(1.3);
box-shadow: 0 0 18px var(--accent-glow-strong);
}
input[type="range"]::-moz-range-thumb {
width: 14px;
height: 14px;
border-radius: 50%;
background: radial-gradient(circle at 40% 40%, var(--accent-secondary) 0%, var(--accent-primary) 100%);
border: none;
box-shadow: 0 0 8px var(--accent-glow), 0 2px 4px rgba(0, 0, 0, 0.3);
cursor: pointer;
}
/* ===== TOGGLES ===== */
.toggle-group {
display: flex;
align-items: center;
justify-content: space-between;
}
.toggle-label {
font-size: 13px;
font-weight: 400;
color: var(--text-primary);
}
.toggle {
width: 44px;
height: 24px;
border-radius: 12px;
background: var(--bg-deep);
border: 1px solid var(--glass-border);
position: relative;
cursor: pointer;
transition: all var(--transition-med);
flex-shrink: 0;
}
.toggle.active {
background: var(--accent-primary);
border-color: var(--accent-primary);
box-shadow: 0 0 12px var(--accent-glow);
}
.toggle::after {
content: '';
position: absolute;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--text-secondary);
top: 2px;
left: 2px;
transition: all var(--transition-med);
}
.toggle.active::after {
transform: translateX(20px);
background: white;
box-shadow: 0 0 6px var(--accent-glow);
}
/* ===== 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;
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);
const themeToggle = document.getElementById('themeToggle');
if (themeToggle) {
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 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 |