Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
/ figma Public archive
forked from figma/widget-samples

FigJam widget code examples & starter projects using the FigJam Widget API

Notifications You must be signed in to change notification settings

onXmaps/figma

 
 

Repository files navigation

FigJam Onx Widgets

lerna

Widgets are custom, interactive FigJam objects you place in a FigJam file to extend FigJam's functionality.

Widgets are written in a declarative style similar to React components, so developers can define what a widget looks like using a component-based API similar to React. If you have written React before you should feel right at home.

A widget is just a "pure function" that returns what gets rendered inside of a node. They can also have their widget run arbitrary code in response to various user interactions, such as click events. Widgets also have custom property menus similar to other FigJam objects.

So far developers have built widgets for people to use together — like voting, polls, and on canvas games. You can see a full list of published widgets here.

Ready to make you first widget? Check out our developer docs to get started!

Widgets

Counter

A simple counter widget that showcases <Frame>, <Text>, useSyncedState, usePropertyMenu, and onClick.

Counter Widget

Notepad

A widget that showcases opening an iframe to get additional user input and the useEffect hook.

Notepad Widget

UserBadge

A widget that makes use of <Image> and figma.currentUser.photoUrl.

UserBadge Widget

Table

A simple table widget that showcases useSyncedMap to support concurrent updates to the widget and the key prop.

Table Widget

Multiplayer Counter

A multiplayer-safe counter widget that uses useSyncedMap and figma.activeUsers[0].sessionId

Multiplayer Counter Widget

create-widget-app

An template widget that opens an iframe whose contents is rendered using React. This mainly serves to demonstrate how to structure code for non-trivial widgets and their iframes.

About

FigJam widget code examples & starter projects using the FigJam Widget API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 70.0%
  • JavaScript 22.8%
  • CSS 6.9%
  • HTML 0.3%