Skip to content

Commit ec21215

Browse files
feat: add storybook and figma pages (#192)
* create page * remove img * add figma * tweaks * fix link * fix image * social images * update figma install instructions & add new gifs * final fixes!
1 parent e21a80d commit ec21215

File tree

9 files changed

+425
-0
lines changed

9 files changed

+425
-0
lines changed

.vitepress/config.ts.timestamp-1700579699301-7af714195b443.mjs

Lines changed: 252 additions & 0 deletions
Large diffs are not rendered by default.
411 KB
Loading
1.72 MB
Loading
1.21 MB
Loading
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
title: How to install and use the StackBlitz plugin for Figma
3+
description: With StackBlitz’s Figma plugin, Dev Mode users can open components in StackBlitz directly from Figma.
4+
og_image: figma-plugin.png
5+
---
6+
7+
# {{ $frontmatter.title }}
8+
9+
[Figma](https://www.figma.com/) is a collaborative UI/UX design tool. Figma’s [Dev Mode](https://www.figma.com/dev-mode/) enables developers to inspect designs, extract code, and access design details, streamlining the design-to-production process.
10+
11+
Figma supports a [number of plugins](https://www.figma.com/community/category/development/plugins) that extend the functionality and integrate additional tools with the platform.
12+
13+
::: tip Available with all StackBlitz plans including **Personal**, **Personal+**, **Teams**, and **Enterprise**.
14+
15+
The plugin is compatible with all Figma plans.
16+
:::
17+
18+
## About the StackBlitz plugin for Figma
19+
20+
With [StackBlitz’s Figma plugin](https://www.figma.com/community/plugin/1287113487428429346), Dev Mode users can open components in StackBlitz directly from Figma.
21+
22+
![StackBlitz's Plugin for Figma Dev Mode](./assets/figma-use.gif)
23+
24+
After configuring the plugin, you will be able to:
25+
26+
- Link layers in Figma to specific components in your design system
27+
- Open the relevant components in an instant, browser-based development environment directly from Figma Dev Mode
28+
- View and modify the relevant component in StackBlitz without any local configuration
29+
- Preview any changes live within StackBlitz
30+
- Commit edits back to the repository or open a pull request
31+
32+
## **Installing the plugin**
33+
34+
To use the StackBlitz plugin, add it to a Figma file from either:
35+
36+
- **The [plugins directory](https://www.figma.com/community/plugin/1287113487428429346)** by clicking “Open in…” and then selecting the name of the file.
37+
38+
39+
- **Dev Mode within your Figma file** by searching for "StackBlitz" under *Plugins*
40+
41+
![Figma plugin directory](./assets/figma-installation.gif)
42+
*Initialize the StackBlitz plugin from within Dev Mode.*
43+
44+
45+
## Using the StackBlitz plugin with Dev Mode
46+
47+
Once you have added the plugin to your Figma file,
48+
49+
1. Enable [Dev Mode](https://www.figma.com/dev-mode/) is on (`Shift` + `D`)
50+
1. Select a layer
51+
1. Open in the StackBlitz plugin and paste a URL of a repository with the code of your project.
52+
- You can also use the URL of a specific file within this repository: typically, a component file, for instance: https://github.com/stackblitz/docs/blob/main/.vitepress/theme/components/CardLists/CardList.vue
53+
1. Click the "Create instant environment link" button to have the link generated for the selected layer.
54+
55+
The link is now added to the layer's Dev resources.
56+
57+
When you click it, a new tab will open with the full IDE loaded with your project. If your link included a file, this file will already be open in the editor.
58+
59+
### Recommended uses for the plugin
60+
61+
We suggest providing instant environment links, especially for the essential components in your app. The components that might need adjustments in future are good candidates as well.
62+
63+
Generally, every time a developer looks at a component in Figma to make changes in the code, having a resource link handy will make their work so much easier!
64+
65+
For more information, [view the StackBlitz plugin in the Figma community directory](https://www.figma.com/community/plugin/1287113487428429346) and refer to the [Figma Dev Mode documentation](https://help.figma.com/hc/en-us/articles/15023124644247-Guide-to-Dev-Mode).
66+
67+
:::info How can we improve this guide?
68+
Haven't found an answer to your question? [Let us know!](mailto:[email protected])
69+
:::
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: How to install and use the StackBlitz addon for Storybook
3+
description: With StackBlitz’s addon, Storybook users can open stories in StackBlitz directly from Storybook.
4+
og_image: storybook-addon.png
5+
---
6+
7+
# {{ $frontmatter.title }}
8+
9+
[Storybook](https://storybook.js.org/) is a widely used open-source tool for building UI components in isolation. It allows developers to create and test UI components interactively, separate from the main application, facilitating easier documentation, debugging, and visual testing of different states and edge cases.
10+
11+
Storybook supports a number of [addons](https://storybook.js.org/docs/addons) that extend the functionality and integrate additional tools.
12+
13+
::: tip Available with all StackBlitz plans including **Personal**, **Personal+**, **Teams**, and **Enterprise**.
14+
15+
The addon is compatible with all Storybook deployments including for Chromatic customers.
16+
:::
17+
18+
## About the StackBlitz addon for Storybook
19+
20+
With StackBlitz’s [addon](https://storybook.js.org/addons/@stackblitz/storybook-addon-stackblitz), Storybook users can open stories in StackBlitz directly from Storybook.
21+
22+
![Open Storybook stories in StackBlitz](./assets/storybook-addon.gif)
23+
24+
After installation, you will be able to:
25+
26+
- Open an instant, browser-based development environment directly from Storybook
27+
- View and modify the relevant component in StackBlitz without a local development environment
28+
- Preview any changes live within StackBlitz
29+
- Commit edits back to the repository or open a pull request
30+
31+
## **Installing the addon**
32+
33+
First, install the addon by running the following command:
34+
35+
::: code-group
36+
37+
```bash [yarn]
38+
yarn add --dev @stackblitz/storybook-addon-stackblitz
39+
```
40+
41+
```bash [npm]
42+
npm install @stackblitz/storybook-addon-stackblitz --save-dev
43+
```
44+
45+
```bash [pnpm]
46+
pnpm add --save-dev @stackblitz/storybook-addon-stackblitz
47+
```
48+
:::
49+
50+
Then, add the addon to `.storybook/main.ts|js`:
51+
52+
53+
```tsx
54+
export default {
55+
addons: ['@stackblitz/storybook-addon-stackblitz'],
56+
};
57+
58+
```
59+
60+
Configure the repository URL in `.storybook/preview.ts|js`:
61+
62+
```tsx
63+
export default {
64+
parameters: {
65+
repositoryUrl: 'https://github.com/[username]/[reponame]'
66+
},
67+
};
68+
```
69+
70+
In your story files, set the file path for the specific story, for instance:
71+
72+
```tsx
73+
export const Primary: Story = {
74+
args: {/* ... */},
75+
parameters: {
76+
filePath: 'src/stories/Button.tsx'
77+
}
78+
};
79+
```
80+
81+
If your components are placed in multiple repositories, you can also define the repository URL for each specific story:
82+
83+
```tsx
84+
export const Primary: Story = {
85+
args: {/* ... */},
86+
parameters: {
87+
filePath: 'src/stories/Button.tsx',
88+
repositoryUrl: 'https://github.com/[username]/[reponame]'
89+
}
90+
};
91+
```
92+
93+
## Using the addon
94+
95+
After successful installation, you will see a new “Open in StackBlitz” button in the navigation. When clicked, this will open the current story in StackBlitz in a new tab.
96+
97+
For more information, [view the StackBlitz addon on Storybook’s integrations page](https://storybook.js.org/addons/@stackblitz/storybook-addon-stackblitz/) and refer to the [Storybook documentation](https://storybook.js.org/docs/).
98+
99+
100+
:::info How can we improve this guide?
101+
Haven't found an answer to your question? [Let us know!](mailto:[email protected])
102+
:::

docs/links.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const groupLinks: Record<MenuLinkGroup, MenuLinkItem[]> = {
2020
{ text: 'Launching projects from GitHub', link: '/guides/integration/open-from-github' },
2121
{ text: 'Creating projects with the SDK', link: '/guides/integration/create-with-sdk' },
2222
{ text: 'Bug reproductions', link: '/guides/integration/bug-reproductions' },
23+
{ text: 'Integrating with Storybook', link: '/guides/integration/storybook-addon' },
24+
{ text: 'Integrating with Figma', link: '/guides/integration/figma-plugin' },
2325
],
2426
codeflow: [
2527
{ text: 'What is Codeflow?', link: '/codeflow/what-is-codeflow' },
241 KB
Loading
246 KB
Loading

0 commit comments

Comments
 (0)