Skip to main content

react-web-components

Guides React integration with web components, including fig-* and toolkit-* elements. Use whenever creating, editing, reviewing, or debugging JSX that contains custom elements or web-component APIs.

Informations de source

Dépôt
rogie/figma-webgpu-shader-studio
Dernière activité de la source
22 septembre 2026 à 11:57
Langue détectée de SKILL.md
anglais
Étoiles
0
Forks
0

Options d'installation

Le prompt qui vérifie d'abord la source est sélectionné par défaut. Vous pouvez passer à une commande directe ou télécharger une copie locale.

Vérifiez les fichiers source

Lisez SKILL.md et les fichiers associés affichés par SkillsMP avant de décider de l'installer.

Affichage de SKILL.md

SKILL.md
Instructions source · Aperçu en lecture seule
name
react-web-components
description
Guides React integration with web components, including fig-* and toolkit-* elements. Use whenever creating, editing, reviewing, or debugging JSX that contains custom elements or web-component APIs.
# React Web Components ## Project rule any web component, such as fig-* or toolkit-* cannot use className terminology in react. it needs class attribute. - Use `class` on every custom element whose tag contains a hyphen. - Continue using `className` on native HTML elements and React components. - Preserve the web component's documented attribute names, including hyphenated names such as `aspect-ratio` and `fig-menu-trigger`. ```jsx <fig-button class="toolbar-button" variant="ghost" icon="true"> <fig-icon name="more" /> </fig-button> <div className="toolbar">...</div> ``` ## React integration - This project uses React 18. For non-string object or function properties, assign the property through a ref in an effect unless the component API explicitly supports an attribute. - JSX handlers are appropriate for standard DOM events such as `click`. Subscribe to web-component custom events with `addEventListener` on a ref and remove the listener during effect cleanup. - Treat presence-based boolean attributes carefully. When false should remove the attribute, use `condition ? "" : undefined` unless the component documents another format. - Before finishing a JSX edit, check all `fig-*`, `toolkit-*`, `tk-*`, and other hyphenated tags for accidental `className` usage. ## Styling FigUI3 and ToolKit components already include their visual design. Do not add custom CSS, extra `class` values, or appearance overrides for `fig-*` / `toolkit-*` unless the user asked. Follow `.cursor/skills/figui3-styling/SKILL.md` and ask first.
Voir sur GitHub