{"id":16328998,"url":"https://github.com/JB1905/react-figma-ui","last_synced_at":"2025-10-25T21:30:52.864Z","repository":{"id":37037685,"uuid":"265358228","full_name":"JB1905/react-figma-ui","owner":"JB1905","description":"🏗️ React implementation for figma-plugin-ds","archived":false,"fork":false,"pushed_at":"2023-08-30T04:50:25.000Z","size":2955,"stargazers_count":41,"open_issues_count":22,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-28T23:23:05.302Z","etag":null,"topics":["components","design","figma","library","patterns","react","system","ui"],"latest_commit_sha":null,"homepage":"https://jb1905.github.io/react-figma-ui/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JB1905.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-19T20:27:44.000Z","updated_at":"2024-03-26T00:27:19.000Z","dependencies_parsed_at":"2024-06-21T18:55:53.089Z","dependency_job_id":"35db8433-b5d3-48f4-ad67-7c24c8988814","html_url":"https://github.com/JB1905/react-figma-ui","commit_stats":{"total_commits":218,"total_committers":4,"mean_commits":54.5,"dds":"0.10550458715596334","last_synced_commit":"0736480b5c62442cb7acfb47ba9a88d594052541"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JB1905%2Freact-figma-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JB1905%2Freact-figma-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JB1905%2Freact-figma-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JB1905%2Freact-figma-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JB1905","download_url":"https://codeload.github.com/JB1905/react-figma-ui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238212356,"owners_count":19434946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["components","design","figma","library","patterns","react","system","ui"],"created_at":"2024-10-10T23:14:38.462Z","updated_at":"2025-10-25T21:30:52.431Z","avatar_url":"https://github.com/JB1905.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# [React Figma UI](https://github.com/JB1905/react-figma-ui)\n\n[![NPM version](https://img.shields.io/npm/v/react-figma-ui?style=flat-square)](https://www.npmjs.com/package/react-figma-ui)\n[![NPM downloads](https://img.shields.io/npm/dm/react-figma-ui?style=flat-square)](https://www.npmjs.com/package/react-figma-ui)\n[![NPM license](https://img.shields.io/npm/l/react-figma-ui?style=flat-square)](https://www.npmjs.com/package/react-figma-ui)\n[![Codecov](https://img.shields.io/codecov/c/github/JB1905/react-figma-ui?style=flat-square)](https://codecov.io/gh/JB1905/react-figma-ui)\n[![Travis](https://img.shields.io/travis/com/JB1905/react-figma-ui/main?style=flat-square)](https://app.travis-ci.com/github/JB1905/react-figma-ui)\n[![Bundle size](https://img.shields.io/bundlephobia/min/react-figma-ui?style=flat-square)](https://bundlephobia.com/result?p=react-figma-ui)\n\n## About\n\nReact implementation for [figma-plugin-ds](https://github.com/thomas-lowry/figma-plugin-ds/) by [Tom Lowry](https://github.com/thomas-lowry/)\n\n### Demo\n\n[**Playground – play with the library in Storybook**](https://jb1905.github.io/react-figma-ui/)\n\n### Alternatives\n\n- [react-figma-plugin-ds](https://github.com/alexandrtovmach/react-figma-plugin-ds/) by [Alexandr Tovmach](https://github.com/alexandrtovmach/)\n- [Figma Styled Components](https://github.com/jhardy/figma-styled-components/) by [Jared](https://github.com/jhardy/)\n- [figma-ui-components](https://github.com/lessmess-dev/figma-ui-components/) by [lessmess](https://github.com/lessmess-dev/)\n- [Figma React UI Kit](https://github.com/LiamMartens/figma-react-ui-kit/) by [Liam Martens](https://github.com/LiamMartens/)\n\n## Contents\n\n- [How to Install](#how-to-install)\n- [Components](#components)\n  - [Button](#button)\n  - [Checkbox](#checkbox)\n  - [Disclosure](#disclosure)\n  - [Icon](#icon)\n  - [Icon button](#icon-button)\n  - [Input](#input)\n  - [Labels and sections](#labels-and-sections)\n  - [Onboarding tip](#onboarding-tip)\n  - [Radio button](#radio-button)\n  - [Select menu](#select-menu)\n  - [Switch](#switch)\n  - [Textarea](#textarea)\n  - [Type](#type)\n\n## How to Install\n\nFirst, install the library in your project by npm:\n\n```sh\n$ npm install react-figma-ui\n```\n\nOr Yarn:\n\n```sh\n$ yarn add react-figma-ui\n```\n\n## Components\n\n### Button\n\nTo use the button, use the following component. Each button has a destructive option. Tertiary buttons are styled like hyperlinks.\n\n```jsx\nimport { Button } from 'react-figma-ui';\n\n// Primary\n\u003cButton tint=\"primary\"\u003eLabel\u003c/Button\u003e\n\u003cButton tint=\"primary\" destructive\u003eLabel\u003c/Button\u003e\n\u003cButton tint=\"primary\" disabled\u003eLabel\u003c/Button\u003e\n\n// Secondary\n\u003cButton tint=\"secondary\"\u003eLabel\u003c/Button\u003e\n\u003cButton tint=\"secondary\" destructive\u003eLabel\u003c/Button\u003e\n\u003cButton tint=\"secondary\" disabled\u003eLabel\u003c/Button\u003e\n\n// Tertiary (Hyperlink style button)\n\u003cButton tint=\"tertiary\"\u003eLabel\u003c/Button\u003e\n\u003cButton tint=\"tertiary\" destructive\u003eLabel\u003c/Button\u003e\n\u003cButton tint=\"tertiary\" disabled\u003eLabel\u003c/Button\u003e\n```\n\n#### Available options\n\n[HTML button element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attributes) and dedicated params\n\n| Param         | Description                                                                            |\n| ------------- | -------------------------------------------------------------------------------------- |\n| `tint`        | Display style for button: primary (filled), secondary (outlined), tertiary (hyperlink) |\n| `destructive` | Add red destructive variant for actions such as deleting something                     |\n\n---\n\n### Checkbox\n\nTo use the checkbox, use the following component. Remember each checkbox should get a unique ID.\n\n```jsx\nimport { Checkbox } from 'react-figma-ui';\n\n// Checkbox unchecked\n\u003cCheckbox id=\"uniqueId\"\u003eLabel\u003c/Checkbox\u003e\n\n// Checkbox checked\n\u003cCheckbox id=\"uniqueId\" checked\u003eLabel\u003c/Checkbox\u003e\n\n// Checkbox disabled\n\u003cCheckbox id=\"uniqueId\" disabled\u003eLabel\u003c/Checkbox\u003e\n```\n\n#### Available options\n\n[HTML input element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes) and dedicated params\n\n| Param                                                                                                             | Description                  |\n| ----------------------------------------------------------------------------------------------------------------- | ---------------------------- |\n| [`containerProps`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) | Props for checkbox container |\n| [`labelProps`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#attributes)                        | Props for label element      |\n\n---\n\n### Disclosure\n\nTo use a disclosure panel, you must use the following component.\n\n```jsx\nimport { Disclosure, DisclosureItem } from 'react-figma-ui';\n\n// Example items\nconst items = [\n  { heading: 'Heading 1', content: 'Content 1', id: 1 },\n  { heading: 'Heading 2', content: 'Content 2', id: 2 },\n  { heading: 'Heading 3', content: 'Content 3', id: 3 },\n];\n\n\u003cDisclosure\n  items={items}\n  render={({ heading, content, id }, index) =\u003e (\n    \u003cDisclosureItem\n      heading={heading}\n      content={content}\n      section={index % 2 === 0}\n      expanded={index % 2 === 1}\n      key={id}\n    /\u003e\n  )}\n/\u003e\n```\n\n#### Available options\n\n**Disclosure**\n\n[HTML ul element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) and dedicated params\n\n| Param    | Description                     |\n| -------- | ------------------------------- |\n| `items`  | Array with disclosure items     |\n| `render` | Render props for DisclosureItem |\n\n**DisclosureItem**\n\n[HTML li element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li#attributes) and dedicated params\n\n| Param                                                                                                           | Description                                   |\n| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |\n| `heading`                                                                                                       | Heading text value                            |\n| `content`                                                                                                       | Content text value                            |\n| `section`                                                                                                       | Style label like a heading                    |\n| `expanded`                                                                                                      | Add this option to have item expanded on load |\n| [`labelProps`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes)   | Props for label element                       |\n| [`contentProps`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) | Props for content element                     |\n\n---\n\n### Icon\n\nTo use the icon, use the following component. Apply the appropriate icon name to select the item you wish to use, you can also add option to change the color, or even spin the icon. You can also specify no icon name to use a text character as an icon (for example, like found in the width + height icon inputs in Figma)\n\n```jsx\nimport { Icon } from 'react-figma-ui';\n\n// Icon\n\u003cIcon iconName=\"theme\" /\u003e\n\n// Icon with blue colorName to change color\n\u003cIcon iconName=\"theme\" colorName=\"blue\" /\u003e\n\n// Spinner Icon with spinning animation\n\u003cIcon iconName=\"spinner\" spin /\u003e\n\n// Text Icon\n\u003cIcon\u003eW\u003c/Icon\u003e\n```\n\n#### Available options\n\n[HTML div element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) and dedicated params\n\n| Param         | Description                                                                        |\n| ------------- | ---------------------------------------------------------------------------------- |\n| `iconName`    | Specify which icon to use (e.g.: `alert`, `draft`, `settings`)                     |\n| `spin`        | Causes the icon to spin in an endless loop (e.g.: loader used with `spinner` icon) |\n| `colorName`\\* | Pass the name of any Figma color var to this prop (e.g.: `blue`, `black3`)         |\n\n\\*Colors accepted: `blue`, `purple`, `purple4`, `hot-pink`, `green`, `red`, `yellow`, `black`, `black8`, `black3`, `white`, `white8`, `white4`\n\n[Preview available icons here](https://github.com/thomas-lowry/figma-plugin-ds/#icon)\n\n---\n\n### Icon button\n\nThe icon button is essentially a wrapper for the icon component.\n\n```jsx\nimport { IconButton } from 'react-figma-ui';\n\n// Icon button with a blend icon\n\u003cIconButton iconProps={{ iconName: 'blend' }} /\u003e\n\n// Icon button with selected option\n\u003cIconButton iconProps={{ iconName: 'blend' }} selected /\u003e\n```\n\n#### Available options\n\n[HTML div element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) and dedicated params\n\n| Param                               | Description                                       |\n| ----------------------------------- | ------------------------------------------------- |\n| `selected`                          | Add this option to have selected style for button |\n| [`iconProps`](#available-options-3) | Props for icon component                          |\n\n---\n\n### Input\n\nTo use the input, use the following component.\n\n```jsx\nimport { Input } from 'react-figma-ui';\n\n// Input with placeholder\n\u003cInput placeholder=\"Placeholder\" /\u003e\n\n// Input with initial value\n\u003cInput value=\"Initial value\" /\u003e\n\n// Disabled input\n\u003cInput value=\"Initial value\" disabled /\u003e\n\n// Input with icon\n\u003cInput value=\"Value\" iconProps={{ iconName: 'angle' }} /\u003e\n```\n\n#### Available options\n\n[HTML input element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes) and dedicated params\n\n| Param                                                                                                             | Description                |\n| ----------------------------------------------------------------------------------------------------------------- | -------------------------- |\n| [`containerProps`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) | Props for switch container |\n| [`iconProps`](#available-options-3)                                                                               | Props for icon component   |\n\n---\n\n### Labels and sections\n\nTo use a label or section, use following components.\n\n```jsx\nimport { Label, SectionTitle } from 'react-figma-ui';\n\n// Label\n\u003cLabel\u003eLabel\u003c/Label\u003e\n\n// Section title\n\u003cSectionTitle\u003eSection title\u003c/SectionTitle\u003e\n```\n\n#### Available options\n\n[HTML div element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes)\n\n---\n\n### Onboarding tip\n\nTo create an onboarding tip, use the following component.\n\n```jsx\nimport { OnboardingTip } from 'react-figma-ui';\n\n\u003cOnboardingTip iconProps={{ iconName: 'styles' }}\u003e\n  Onboarding tip goes here.\n\u003c/OnboardingTip\u003e\n```\n\n#### Available options\n\n[HTML div element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) and dedicated params\n\n| Param                                                                                                             | Description                |\n| ----------------------------------------------------------------------------------------------------------------- | -------------------------- |\n| [`containerProps`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) | Props for switch container |\n| [`iconProps`](#available-options-3)                                                                               | Props for icon component   |\n\n---\n\n### Radio button\n\nTo create an radio button, use the following component. Remember each group of radio buttons must share the same name so that they are related to one another. Each button should have a unique id so that its label is associated with it and remains part of the clickable hit area.\n\n```jsx\nimport { Radio } from 'react-figma-ui';\n\n// Radio button\n\u003cRadio value=\"Value\" id=\"radioButton1\" name=\"radioGroup\"\u003eRadio button\u003c/Radio\u003e\n\n// Radio button checked\n\u003cRadio value=\"Value\" id=\"radioButton2\" name=\"radioGroup\" checked\u003eRadio button\u003c/Radio\u003e\n\n// Radio button disabled\n\u003cRadio value=\"Value\" id=\"radioButton3\" name=\"radioGroup\" disabled\u003eRadio button\u003c/Radio\u003e\n```\n\n#### Available options\n\n[HTML input element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes) and dedicated params\n\n| Param                                                                                                             | Description               |\n| ----------------------------------------------------------------------------------------------------------------- | ------------------------- |\n| [`containerProps`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) | Props for radio container |\n| [`labelProps`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#attributes)                        | Props for label element   |\n\n---\n\n### Select menu\n\nTo create an select menu, use following components.\n\nThe select menu will open and position the menu to the selected object. If there is no vertical room inside your plugin's iFrame, the position of the menu will be moved to ensure it fits inside the iframe. If you have a select menu with too many options to fit within the iFrame, the menu will scroll vertically.\n\n```jsx\nimport { SelectMenu, SelectMenuOption } from 'react-figma-ui';\n\n// Example options\nconst options = [\n  { value: 1, label: 'Option 1' },\n  { value: 2, label: 'Option 2' },\n  { value: 3, label: 'Option 3' },\n];\n\n() =\u003e (\n  \u003cSelectMenu\n    options={options}\n    render={({ value, label }) =\u003e (\n      \u003cSelectMenuOption value={value} key={value}\u003e\n        {label}\n      \u003c/SelectMenuOption\u003e\n    )}\n  /\u003e\n);\n```\n\n#### Available options\n\n**SelectMenu**\n\n[HTML select element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) and dedicated params\n\n| Param     | Description                       |\n| --------- | --------------------------------- |\n| `options` | Array with select menu options    |\n| `render`  | Render props for SelectMenuOption |\n\n**SelectMenuOption**\n\n[HTML option element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes)\n\n---\n\n### Switch\n\nTo use the switch, use the following component. Remember each switch should get a unique ID that is referenced in the label. This ensures the switch and the entire label are clickable.\n\n```jsx\nimport { Switch } from 'react-figma-ui';\n\n// Switch\n\u003cSwitch id=\"uniqueId\"\u003eLabel\u003c/Switch\u003e\n\n// Switch checked\n\u003cSwitch id=\"uniqueId\" checked\u003eLabel\u003c/Switch\u003e\n\n// Switch disabled\n\u003cSwitch id=\"uniqueId\" disabled\u003eLabel\u003c/Switch\u003e\n```\n\n#### Available options\n\n[HTML input element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes) and dedicated params\n\n| Param                                                                                                             | Description                |\n| ----------------------------------------------------------------------------------------------------------------- | -------------------------- |\n| [`containerProps`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) | Props for switch container |\n| [`labelProps`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#attributes)                        | Props for label element    |\n\n---\n\n### Textarea\n\nTo use the textarea, use the following component.\n\n```jsx\nimport { Textarea } from 'react-figma-ui';\n\n// Textarea\n\u003cTextarea value=\"Initial value\" rows={2} /\u003e\n\n// Textarea disabled\n\u003cTextarea value=\"Initial value\" rows={2} disabled /\u003e\n```\n\n#### Available options\n\n[HTML textarea element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attributes)\n\n---\n\n### Type\n\nTo use the typography that is styled like it is in the Figma UI, use the following component plus additional options to modify the size, weight, and letterspacing that is optimized for positive (dark text on light background) and negative (light text on dark background) applications.\n\n```jsx\nimport { Type } from 'react-figma-ui';\n\n\u003cType\u003eUI11, size: xsmall (default) weight: normal, positive\u003c/Type\u003e\n\n\u003cType\u003eUI13, size: large, weight: bold, positive\u003c/Type\u003e\n\n\u003cType size=\"large\" weight=\"medium\" inverse\u003eUI12, size: large, weight: medium, negative\u003c/Type\u003e\n```\n\n#### Available options\n\n[HTML div element props](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes) and dedicated params\n\n| Param     | Description                                                                                         |\n| --------- | --------------------------------------------------------------------------------------------------- |\n| `size`    | Font size: **small** - 12px, **large** - 13px, **xlarge** - 14px                                    |\n| `weight`  | Font weight: medium, bold                                                                           |\n| `inverse` | Inverted (negative) application where light text is on dark background with increased letterspacing |\n\n_Defaults: Font size 11px, normal weight, positive application_\n\n## License\n\nThis project is licensed under the MIT License © 2020-present Jakub Biesiada\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJB1905%2Freact-figma-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJB1905%2Freact-figma-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJB1905%2Freact-figma-ui/lists"}