FigUI3 core (fig.js)

SkillMedia

Guides 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.

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";
BundleCSS + JSComponents
Core (this skill)fig.css + fig.jsAll fig-* in components.md
Editorfig-editor.css + fig-editor.jsfig-select*, fig-fill-picker, fig-interpolation-swatch
Layerfig-layer.css + fig-layer.jsfig-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

  1. Prefer existing fig-* tags over one-off markup.
  2. Use design tokens (--figma-color-*, --radius-*, --spacer-*). Do not hardcode Figma colors.
  3. Emit input while interacting and change on commit. Do not fire input from programmatic attribute writes.
  4. Preserve a11y: labels, keyboard, ARIA, disabled. See the a11y skill.
  5. Keep components framework-agnostic. No React internals in fig.js.

Overlay rules

  • <dialog is="fig-dialog"> — modal/task dialog. position is viewport placement. No anchor.
  • <dialog is="fig-popup"> — anchored float (anchor, position, offset, viewport-margin). title auto-builds a header. variant="popover" uses CSS filter (containing block for position: fixed). Sticky fig-separator + fig-menu-item lists scroll on the popup.
  • <dialog is="fig-toast"> — call showToast(). theme, duration, live, dismiss, icon.
  • fig-menu and fig-select use popover="manual" so lists escape filter-containing popups to the top layer. Nested menus inside popovers must keep that. fig-menu slots items (does not relocate them); triggers get slot="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

TagBundleUse
fig-dropdowncoreNative <select> wrapper. type="select|dropdown", variant="ghost"
fig-selecteditorCustom 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

  1. Read fig.js + components.css before editing.
  2. Update README.md + CHANGELOG.md for public API changes.
  3. bun build for dist.
  4. 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