Skip to Content
Components

Design tuner

Tweak a component by hand or let the agent tune it.

A live preview beside a few sliders, with a button that hands the tuning to the agent. Drag a slider — or arrow-key it — to tweak the sample card by hand, or press Tune with agent and it walks each value to a target, turns the row it is moving accent, and drops a note on what it changed. Each slider sets a --dm-<key> variable on the preview, so the card reshapes live.

Preview
Pro
$24per editor, monthly
Unlimited framesAgent reviewsShared tokens
Pricing cardEdited by you
Radius
16px
Padding
18px
Spacing
12px
Shadow
0.08

Usage

<!-- include core.css + design-tuner.css -->
<div class="dtx">
  <div class="dtx-prev"><div class="dtx-card"><!-- sample card --></div></div>
  <div class="dtx-insp panel">
    <div class="dtx-ih"><b>Pricing card</b><span class="muted dtx-st">Edited by you</span></div>
    <div class="dtx-rows"><!-- a .dtx-r row per slider --></div>
    <button class="pill primary sm dtx-go">Tune with agent</button>
  </div>
</div>

Properties

NameTypeDescription
paramsTunerParam[]The sliders. Defaults to radius, padding, spacing and shadow for the sample card.
valuesRecord<string, number>The value of each slider by key. Leave it out to let the sliders keep their own.
onValuesChange(values) => voidFires with the values by key whenever a slider or the agent moves one.
titlestringWhat is being tuned, like "Pricing card".
statusstringQuiet line beside the title, like "Edited by you" or "Agent is tuning".
activestringKey of the slider the agent is moving now; its value turns the accent colour.
tuningbooleanThe agent is tuning: the button thinks and stops taking clicks.
noteReactNodeWhat the agent changed and why, shown above the button.
actionLabelstringThe button's label, like "Tune with agent" or "Tune again".
onTune() => voidFires when the agent-tune button is pressed.

A TunerParam is { key, label, min, max, value, unit?, decimals? }: key names the --dm-<key> variable the preview reads, unit is appended to whole numbers (like px), and decimals shows and sets the value with that many decimals instead of rounding.

Theming

Works in light and dark (data-theme="dark") and in the Soft style (data-style="soft"). The preview sits on a chip-tinted stage; the slider fill and knob, the accent CTA and the agent's note all draw from the theme tokens, and the sample card's own radius, padding, spacing and shadow are exactly what the sliders drive. The agent respects prefers-reduced-motion, snapping to the tuned values instead of walking them.

On this page