FigUI3 core (fig.js)
SkillMediaGuides FigUI3 core (`fig.js` / `fig.css`) web components for Figma-style plugin UIs, including React JSX usage. Use when adding, using, or debugging fig-* elements from the core bundle—buttons, fields, overlays, menus, sliders, color/fill inputs, media, dialogs, popups, toasts. Not for fig-select or fig-fill-picker (fig-editor),
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the FigUI3 core (fig.js) skill
What this skill tells your AI
The instructions your AI receives, as published by rogie/figui3 in skills/figui3/SKILL.md and read by ahel’s review.
Zero-dependency web components for Figma UI3 plugin and widget UIs.
Public API: README.md. React: react.md. Per-tag JSX: components.md. Attrs: reference.md.
Bundles
Always import CSS with JS. Register before first render. In React, see react.md.
import "@rogieking/figui3/fig.css";
import "@rogieking/figui3/fig.js";
| Bundle | CSS + JS | Components |
|---|---|---|
| Core (this skill) | fig.css + fig.js | All fig-* in components.md |
| Editor | fig-editor.css + fig-editor.js | fig-select*, fig-fill-picker, fig-interpolation-swatch |
| Layer | fig-layer.css + fig-layer.js | fig-layer |
fig-editor.js also imports fig.js and fig-lab.js. Lab CSS is still separate. fig-layer is not registered by fig-editor.js. Toast is core; layer is fig-layer.js.
Principles
- Prefer existing
fig-*tags over one-off markup. - Use design tokens (
--figma-color-*,--radius-*,--spacer-*). Do not hardcode Figma colors. - Emit
inputwhile interacting andchangeon commit. Do not fireinputfrom programmatic attribute writes. - Preserve a11y: labels, keyboard, ARIA, disabled. See the
a11yskill. - Keep components framework-agnostic. No React internals in
fig.js.
Overlay rules
<dialog is="fig-dialog">— modal/task dialog.positionis viewport placement. Noanchor.<dialog is="fig-popup">— anchored float (anchor,position,offset,viewport-margin).titleauto-builds a header.variant="popover"uses CSSfilter(containing block forposition: fixed). Stickyfig-separator+fig-menu-itemlists scroll on the popup.<dialog is="fig-toast">— callshowToast().theme,duration,live,dismiss,icon.fig-menuandfig-selectusepopover="manual"so lists escape filter-containing popups to the top layer. Nested menus inside popovers must keep that.fig-menuslots items (does not relocate them); triggers getslot="trigger".
<dialog is="fig-dialog" drag handle="fig-header">
<fig-header>
Title
<fig-button variant="ghost" icon close-dialog aria-label="Close">
<fig-icon name="close" />
</fig-button>
</fig-header>
<fig-content>Body</fig-content>
</dialog>
Field composition
<fig-field direction="horizontal">
<label>Opacity</label>
<fig-slider value="75" min="0" max="100" text="true" units="%" full />
</fig-field>
Select vs dropdown
| Tag | Bundle | Use |
|---|---|---|
fig-dropdown | core | Native <select> wrapper. type="select|dropdown", variant="ghost" |
fig-select | editor | Custom listbox: groups, overflow chevrons, sticky separators, rich options |
Prefer fig-select for Figma-style menus. Use fig-dropdown only for a native select.
Events
fig-slider input/change → e.currentTarget.value
fig-input-color input/change → detail { color, alpha, opacity } plus legacy value/hex/rgba
fig-input-fill input/change → fill payload in e.detail
fig-menu change → detail { value }
fig-dialog/popup native dialog close plus FigUI3 positioning attrs
fig-input-angle and fig-input-wheel are lab, not core.
Maintainer workflow
- Read
fig.js+components.cssbefore editing. - Update
README.md+CHANGELOG.mdfor public API changes. bun buildfor dist.- Tests:
npm run test:components(Playwright).
Primary files: fig.js, components.css, base.css, README.md.
Signals
- GitHub stars
- 66
- Forks
- 1
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
figui3- Source
- github.com/rogie/figui3