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

figmakit-plugin-ui-svelte

v2.0.1

Published

A component library for building Svelte 5 based Figma plugins

Downloads

129

Readme

FigmaKit Plugin UI Svelte

A comprehensive component library for Svelte-based Figma plugins, providing authentic Figma UI elements with Svelte 5 support. Built to deliver a familiar, high-quality experience that matches Figma's native interface.

Quick Start

Installation

npm install figmakit-plugin-ui-svelte

Basic Setup

<script lang="ts">
	import { Button, Input, Switch } from 'figmakit-plugin-ui-svelte';

	// Import required global styles
	import 'figmakit-plugin-ui-svelte/dist/css/resets.css';
	import 'figmakit-plugin-ui-svelte/dist/css/global.css';
</script>

<Button onclick={() => console.log('Clicked!')}>Click Me</Button>

CSS Variable Autocomplete (VS Code)

Add to .vscode/settings.json for CSS variable autocomplete:

{
	"cssVariables.lookupFiles": [
		"node_modules/figmakit-plugin-ui-svelte/dist/css/global.css",
		"node_modules/figmakit-plugin-ui-svelte/dist/css/resets.css",
		"node_modules/figmakit-plugin-ui-svelte/dist/css/figma-styles-for-testing.css"
	]
}

Demo Page

Run npm run dev after cloning to see all components in action with usage examples.


Components

Button

Primary action component with multiple variants and states.

Button variants

| Prop | Type | Default | Description | | ------------- | ---------------------------------------- | ----------- | --------------------------- | | variant | 'primary' \| 'secondary' \| 'tertiary' | 'primary' | Button style variant | | size | 'default' \| 'large' | 'default' | Button size | | destructive | boolean | false | Applies destructive styling | | disabled | boolean | false | Disables the button | | icon | string | undefined | SVG icon string | | onclick | (event: MouseEvent) => void | undefined | Click handler |

<Button variant="primary" onclick={() => console.log('Primary clicked')}>Primary Action</Button>
<Button variant="secondary" size="large" icon={IconAdjust}>Secondary</Button>
<Button variant="tertiary" destructive>Delete</Button>

Input

Text input component with label, validation, and icon support.

Input fields

| Prop | Type | Default | Description | | -------------- | --------- | --------------------------- | ------------------------ | | label | string | required | Input label text | | showLabel | boolean | true | Show/hide label visually | | placeholder | string | 'Input something here...' | Placeholder text | | disabled | boolean | false | Disables the input | | invalid | boolean | false | Shows error state | | errorMessage | string | 'Error message' | Error message text | | icon | string | undefined | Left-side icon | | borders | boolean | true | Show/hide borders | | value | string | '' | Input value (bindable) |

<Input label="Email" placeholder="Enter your email" />
<Input label="Search" icon={IconAdjust} />
<Input label="Name" invalid errorMessage="Name is required" />

Checkbox

Standard checkbox input with label support.

Checkbox states

| Prop | Type | Default | Description | | ---------- | ------------------------ | ----------- | ------------------------ | | checked | boolean | false | Checked state (bindable) | | disabled | boolean | false | Disables the checkbox | | value | string | undefined | Form value | | onchange | (event: Event) => void | undefined | Change handler |

<Checkbox onchange={(e) => console.log('Changed:', e.target.checked)}>
	Enable notifications
</Checkbox>
<Checkbox checked disabled>Read-only option</Checkbox>

Switch

Toggle switch component for binary options.

Switch states

| Prop | Type | Default | Description | | ---------- | ------------------------ | ----------- | ----------------------- | | checked | boolean | false | Switch state (bindable) | | disabled | boolean | false | Disables the switch | | onchange | (event: Event) => void | undefined | Change handler |

<Switch checked onchange={() => console.log('Toggled')}>Dark mode</Switch>

Radio

Radio button component for single selection from a group.

Radio button group

| Prop | Type | Default | Description | | ---------- | ------------------------ | ----------- | ------------------ | | group | string \| number | required | Bound group value | | value | any | required | This radio's value | | disabled | boolean | false | Disables the radio | | onchange | (event: Event) => void | undefined | Change handler |

<script>
	let selectedOption = 'option1';
</script>

<Radio bind:group={selectedOption} value="option1">Option 1</Radio>
<Radio bind:group={selectedOption} checked value="option2">Option 2</Radio>

Textarea

Multi-line text input component.

Textarea with label

| Prop | Type | Default | Description | | ------------- | --------- | --------------------------- | ------------------------- | | label | string | required | Textarea label | | showLabel | boolean | true | Show/hide label visually | | rows | number | 2 | Number of visible rows | | placeholder | string | 'Input something here...' | Placeholder text | | disabled | boolean | false | Disables the textarea | | value | string | '' | Textarea value (bindable) |

<Textarea label="Description" rows={4} placeholder="Enter description..." />

IconButton

Compact button component with icon only. Label for acessibility.

Icon buttons

| Prop | Type | Default | Description | | ---------- | ----------------------------- | ----------- | ------------------- | | icon | string | required | SVG icon string | | label | string | undefined | Accessibility label | | disabled | boolean | false | Disables the button | | onclick | (event: MouseEvent) => void | undefined | Click handler |

<IconButton icon={IconClose} label="Close" onclick={handleClose} />

ToggleButton

Button with checked state.

Toggle buttons

| Prop | Type | Default | Description | | ---------- | ---------------------------- | ----------- | ----------------------- | | checked | boolean | false | Toggle state (bindable) | | disabled | boolean | false | Disables the button | | icon | string | undefined | Optional icon | | onchange | (checked: boolean) => void | undefined | State change handler |

<ToggleButton onchange={(checked) => console.log('Toggled:', checked)}>Favorite</ToggleButton>
<ToggleButton icon={IconAdjust} />

MultiMenu

Advanced dropdown menu with nested groups, single/multi-select, and actions.

Dropdown menu

| Prop | Type | Default | Description | | -------------------- | -------------------------- | ----------- | --------------------------------- | | groups | MenuGroup[] | required | Menu structure array | | triggerType | 'button' \| 'select' | 'button' | Trigger button style | | showSelectedValues | boolean | false | Display selected items in trigger | | icon | string | undefined | Trigger icon | | disabled | boolean | false | Disables the menu | | onclick | (action: string) => void | undefined | Action click handler |

<MultiMenu
	groups={[
		{
			name: 'file',
			label: 'File',
			children: [
				{ label: 'New', action: 'new' },
				{ label: 'Open', action: 'open' }
			]
		}
	]}
	triggerType="select"
	showSelectedValues
/>

Dialog

Modal dialog component with header and customizable content.

Dialog modal

| Prop | Type | Default | Description | | --------- | ------------------------ | ----------- | ----------------------------------- | | title | string | required | Dialog title | | dialog | HTMLDialogElement | undefined | Dialog element reference (bindable) | | onclose | (event: Event) => void | undefined | Close handler |

<script>
	let myDialog;
</script>

<Button onclick={() => myDialog?.showModal()}>Open Dialog</Button>

<Dialog bind:dialog={myDialog} title="Confirmation">
	<p>Are you sure you want to continue?</p>
	<Button onclick={() => myDialog?.close()}>Close</Button>
</Dialog>

Disclosure

Collapsible sections with expand/collapse functionality.

| Prop | Type | Default | Description | | ---------- | --------- | ------- | ---------------------------- | | multiple | boolean | false | Allow multiple sections open |

DisclosureItem Props:

| Prop | Type | Default | Description | | ---------- | --------- | ---------- | --------------------------------- | | title | string | required | Section title | | expanded | boolean | false | Initial expanded state (bindable) | | section | boolean | false | Bold section styling |

<Disclosure multiple>
	<DisclosureItem title="Section 1" expanded>Content for section 1</DisclosureItem>
	<DisclosureItem title="Section 2">Content for section 2</DisclosureItem>
</Disclosure>

Icon

Flexible icon component for displaying SVG icons.

| Prop | Type | Default | Description | | ------- | --------- | ----------- | ----------------------------- | | icon | string | required | SVG icon string | | size | number | 24 | Icon size in pixels | | color | string | undefined | CSS color variable | | spin | boolean | false | Continuous rotation animation |

<Icon icon={IconAdjust} size={16} />
<Icon icon={IconCheck} color="--figma-color-icon-success" />

Other Components

Label: Text labels for form sections Type: Typography component with size and weight variants
OnboardingTip: Informational tips with icons as seen in the right sidebar


Icons

The library includes essential Figma UI icons for the above components. You can also copy SVG icons directly from Figma and import them in your project:

  1. Open the Figma console/dev tools
  2. Navigate to an SVG icon in the UI with the element picker
  3. Save it as SVG file
  4. Use with Icon component: <Icon icon={copiedSvgString} />

Development

Getting Started

git clone https://github.com/KaiMagnusMueller/figmakit-plugin-ui.git
cd figmakit-plugin-ui
npm install
npm run dev

Everything inside src/lib is the library, src/routes contains the demo page.

Building & Publishing

# Build library
npm run package

# Build demo site
npm run build

# Publish to npm
npm publish
# or for beta releases
npm publish --tag beta

Version Management

npm version patch      # 2.0.0 → 2.0.1
npm version minor      # 2.0.0 → 2.1.0
npm version major      # 2.0.0 → 3.0.0
npm version prerelease --preid=beta  # → 2.0.1-beta.1

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any suggestions or improvements.

License

MIT License - see LICENSE for details.


Built on top of figma-plugin-ds-svelte - thanks to the original author Thomas Lowry!