Dynamic Variables
Variables that compute themselves: write a formula once, and colors, spacing and type stay in sync!
Plugin Preview
About this plugin
Change one base variable โ every dependent color, spacing and type value updates itself.Dynamic Variables lets your Figma variables derive from each other: write a small JavaScript formula in a variable's description field, and the plugin keeps its value in sync with everything it depends on.๐จ primary-600: {{ cd($base-color).darken(0.1) }} โ correct today, correct after every rebrand.You know the ritual: the brand color shifts, and now it's 20 shades ร light-and-dark modes of hand edits โ and the one shade you miss is the one that ships. Type scale tweak? Same ritual. Spacing rhythm? Same. Your tokens already depend on each other โ Figma just doesn't know it yet. This plugin is how you tell it.๐ Try it before installing: the documentation runs every example live in your browser โ editable variables, editable expressions, visual previews. Two minutes there and you'll know if this is for you.โจ NEW in 2.0 โ you don't even have to write the formulas:๐ค AI-assisted editing: click Copy Brief for AI, paste it into ChatGPT, Claude, Gemini โ whatever assistant you already use โ describe what you want in plain words, then paste the reply back. The plugin parses it and shows a preview of every change before anything touches your variables โ it can update expressions and even create the variables it needs. Or hand the brief straight to the Figma Agent, which edits your variables directly. No API key, no extra subscription.๐ฅ๏ธ Visual editor: browse collections as a tree and edit expressions in a real code editor (Monaco โ the engine inside VS Code) with syntax highlighting, autocomplete for your variable names, and inline errors, instead of squinting at description fields.๐งฉ Global Functions: define a helper once โ say, a function that picks readable text for any background โ and call it from any expression. Repeated logic lives in one place.๐๏ธ Relative paths, on by default: $('./Base') reads a sibling, $('../radius') reads one group up โ so one generic expression serves a whole family of tokens and survives renames of the family itself.๐ Motion variables: Figma's new Timing & Easing types are supported โ switch easing curves by condition (reduced motion, brand, platform) via alias selection, and export any curve as CSS with cssEasing().๐ How it works:โ๏ธ Expressions: any JavaScript between {{ }} in a variable's description. Reference siblings as $A, other collections as $('Collection/Variable'). A variable C defined as {{ $A + $B }} updates whenever A or B changes.๐จ Color science built in: colord (cd) and culori (cl, cv): {{ cd($color).lighten(0.2) }}, WCAG luminance {{ cl.wcagLuminance($brand) }}, OKLCH with gamut clamping {{ cl.clampRgb(cv("oklch(90% 0.4 135)")) }}, plus Figma-style {{ rgba("green") }}.๐ง Mode-aware logic: one expression, different behavior per mode โ {{ ($$().mode == "Mobile" ? 1 : 2) * $base-padding }}. Read a variable's own name, collection and modes through the $$() metadata object to write scale steps that compute themselves from their names.๐ Two run modes: Start Monitoring Changes (live updates at your chosen interval, pause/resume anytime) or Update Once when you want full control.๐ Rename-proof: references fix themselves when variables are renamed or moved.๐ Library variables: bring team-library variables in as aliases and use them in expressions.โ Honest errors: cyclic dependencies, unresolved references, type mismatches โ reported per variable, per mode, in the editor.๐ Live data: expressions can fetch. This works, today, in a variable: ๐ค nyc-feels-like: {{ fetch("https://api.open-meteo.com/v1/forecast?latitude=40.71&longitude=-74.01¤t=apparent_temperature&temperature_unit=fahrenheit").then(r => r.json()).then(d => Math.round(d.current.apparent_temperature) + "ยฐF") }} โ the current feels-like temperature in New York, in your prototype. Same trick for prices, or just the time: {{ new Date().toLocaleTimeString("en-GB") }}.๐ก What people build with it:๐จ Full color ramps from one seed โ 50โฆ950, light and dark, self-updating๐ Spacing systems: #๏ธโฃ spacing-s: {{ $base-spacing * 2 }}, density modes included๐๏ธ Type scales: #๏ธโฃ heading-md: {{ Math.round($heading-sm * 1.2) }}โ๏ธ Accessible on-colors: pick black or white text by actual contrast math, per mode๐ค Composed strings: {{ "Hello, $user-name!" }} for copy that assembles itselfโบ๏ธ Conditional tokens, Material-style state layers, concentric radii โ if JavaScript can compute it, a variable can be it๐ณ Free & Pro: everything is free for up to 5 dynamic variables, forever โ enough to feel the click. Need more? A full-featured trial (7 or 14 days, depending on variant) has no cap. Pro removes the limit and funds development.Buy Pro LicenseAfter purchase: Dynamic Variables โ Pro License โ Activate Key. Licenses cover 5 devices (10 on Unlimited). Reinstalling your OS? I can reset your activations โ just write me.Subscribe for updates๐ Links:๐ Interactive documentation โ live playgrounds, syntax, relative paths, $$() metadata, AI editing, recipes (and a small thank-you at the end for those who read it all)๐ฌ Feedback and use cases โ comments below. I read everything, and roadmap items regularly come from here.
Plugin Details
| Version | 26 |
|---|---|
| Created | April 25, 2024 |
| Last Updated | July 25, 2026 |
| Category | design-tools-other |
| Creator | Neil Akhmetov |
| Stats | 628 installs, 143 likes |
| Pricing | Paid |
Technical Details
- API:1.0.0
- UI:editor.html
- main:code.js
- Document Access:dynamic-page
- Network Access:
Users can input any URL for variables to fetch data from. Plugin itself does not make any network requests.
- Editor Types:figma
- Allowed Domains:
- *
More Like This
Discover other plugins in the design-tools-other category.