npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

figma-plugin-preact-ui

v1.1.0

Published

Preact UI library inspired by Figma's UI3, designed for plugin development.

Downloads

282

Readme

Figma Plugin UI Library (Preact)

An unofficial loose interpretation of Figma's UI3 design language, adapted for plugin interfaces (Preact/React-compatible):

  • Providing components and states relevant to plugin development.
  • Optimizing the system for practical, real-world plugin workflows.
  • Maintaining visual alignment with the current look & feel of Figma’s interface.

This project is an independent initiative and is not affiliated with or endorsed by Figma.

Demo and documentation · Canvas Tools

Preview

Getting started

Install

Use your preferred package manager. This library has peer dependencies on preact and @preact/compat.

npm install figma-plugin-preact-ui preact @preact/compat
# or
pnpm add figma-plugin-preact-ui preact @preact/compat
# or
yarn add figma-plugin-preact-ui preact @preact/compat

Basic usage (consumer project)

Import the component(s) you need and the bundled CSS, then render with Preact. For React, use @preact/compat so the same components run in React-based setups.

import { render } from 'preact'
import { Button } from 'figma-plugin-preact-ui'
import 'figma-plugin-preact-ui/dist/themes.css'

function App() {
  return (
    <div class="app">
      <Button>Hello world!</Button>
    </div>
  )
}

render(<App />, document.getElementById('root')!)

Types and tree‑shaking

The package ships ESM and TypeScript types. You can import prop types if needed:

import { Button } from 'figma-plugin-preact-ui'
import type { ButtonProps } from 'figma-plugin-preact-ui'

Components are individually exported from the entry, enabling tree‑shaking by modern bundlers.

CSS is emitted per component chunk: importing a component pulls in its styles automatically, as long as your bundler follows ESM imports. You still need themes.css so spacing, radius, and color variables (and the shared body / #root base rules) are defined.

import { Button } from 'figma-plugin-preact-ui'
import 'figma-plugin-preact-ui/dist/themes.css'

For a single full stylesheet (tokens + every component’s CSS), import style.css (not styles.css):

import { Button } from 'figma-plugin-preact-ui'
import 'figma-plugin-preact-ui/dist/style.css'

The CSS provides design tokens and component styles. Theming is controlled by the .figma-light or .figma-dark classes provided by Figma in the plugin window.

You can consume the CSS variables from the library directly.

In Storybook: Overview and design tokens under Variables: Spacing, Radius, Colors.

CSS

.card {
  padding: var(--pui-spacing-400);
  border-radius: var(--pui-radius-medium);
}

.title {
  color: var(--pui-color-neutral-text-default);
}

Inline styling

import { render } from 'preact'
import { Button } from 'figma-plugin-preact-ui'
import 'figma-plugin-preact-ui/dist/themes.css'

const style = {
  padding: 'var(--pui-spacing-400)',
  borderRadius: 'var(--pui-radius-medium)',
}

function App() {
  return (
    <div class="app" {...style}>
      <Button>Hello world!</Button>
    </div>
  )
}

render(<App />, document.getElementById('root')!)

JS variables

Theme objects expose the same values as CSS variables (nested keys mirror the token path). Numeric spacing scale keys must use bracket notation.

import { figmaLight, spacing, radius } from 'figma-plugin-preact-ui'
// Same nested `variables` shape: figmaDark, figjamLight

const surface = figmaLight.variables.neutral.bg.default // e.g. #FFFFFF (figma-light)
const titleColor = figmaLight.variables.neutral.text.default // matches var(--pui-color-neutral-text-default)
const pad = spacing.variables['400'] // "16px"
const round = radius.variables.medium // "5px"

Theming

Theming is tied to the .figma-light or .figma-dark classes provided by Figma in the plugin window.

You can add a class such as .figjam on the plugin root for the FigJam color theme (see themes.css).

Color variables are scoped under those classes in themes.css; spacing and radius live on :root.

Third-party UI building blocks

Some components wrap bundled dependencies (for example Calendar, ColorPicker, and TimePicker). You do not need to install those packages separately when using this library’s components.

Changelog

All notable changes to this project are documented in CHANGELOG.md.

License

Released under the MIT License.