Skip to main content

figui3

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, toolbelts, sliders, color/fill inputs, media, dialogs, popups, toasts. Not for fig-select or fig-fill-picker (fig-editor),

소스 정보

저장소
rogie/figui3
최근 소스 활동
2026년 10월 2일 15:02
감지된 SKILL.md 언어
영어
스타
66
포크
1

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
4 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
figui3
description
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, toolbelts, sliders, color/fill inputs, media, dialogs, popups, toasts. Not for fig-select or fig-fill-picker (fig-editor),
user-invocable
false
# FigUI3 core (`fig.js`) Zero-dependency web components for Figma UI3 plugin and widget UIs. Public API: `README.md`. React: [react.md](react.md). Per-tag JSX: [components.md](components.md). Attrs: [reference.md](reference.md). ## Bundles Always import CSS with JS. Register before first render. In React, see [react.md](react.md). ```js 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](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 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"`. ```tsx <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 ```tsx <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 ```txt 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-angle` is core. `fig-input-wheel` remains **lab**. ## 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`.
GitHub에서 보기