Created
March 31, 2025 16:08
-
-
Save aashreys/f35a938cb8ac93be6c1ea614c63fc481 to your computer and use it in GitHub Desktop.
Reusable components in Figma Widgets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// is it possible to package widget UI elements into discrete reusable react-style components? | |
// I'd like to reuse some UI elements across my widget and currently do not know how to achieve this. | |
interface Props { | |
name: string; | |
} | |
function HelloWorld({ name }: Props) { | |
return <figma.widget.Text>Hello, {name}!</figma.widget.Text> | |
} | |
function Widget() { | |
return <HelloWorld name="Jake" /> | |
} | |
figma.widget.register(Widget); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment