Skip to content

Instantly share code, notes, and snippets.

@aashreys
Created March 31, 2025 16:08
Show Gist options
  • Save aashreys/f35a938cb8ac93be6c1ea614c63fc481 to your computer and use it in GitHub Desktop.
Save aashreys/f35a938cb8ac93be6c1ea614c63fc481 to your computer and use it in GitHub Desktop.
Reusable components in Figma Widgets
// 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