Product
Introducing Java Support in Socket
We're excited to announce that Socket now supports the Java programming language.
@storybook/addon-designs
Advanced tools
Storybook addon for embedding your design preview in addon panel
@storybook/addon-designs is an addon for Storybook that allows you to embed design resources directly into your stories. This helps in bridging the gap between design and development by providing a visual reference for developers.
Embed Figma designs
This feature allows you to embed Figma designs directly into your Storybook stories. By providing a URL to the Figma file, you can display the design alongside the component.
import { withDesign } from 'storybook-addon-designs';
export default {
title: 'Button',
decorators: [withDesign],
};
export const Primary = () => <button>Primary</button>;
Primary.parameters = {
design: {
type: 'figma',
url: 'https://www.figma.com/file/xyz123'
},
};
Embed Sketch designs
This feature allows you to embed Sketch designs into your Storybook stories. By providing a URL to the Sketch file, you can display the design alongside the component.
import { withDesign } from 'storybook-addon-designs';
export default {
title: 'Button',
decorators: [withDesign],
};
export const Primary = () => <button>Primary</button>;
Primary.parameters = {
design: {
type: 'sketch',
url: 'https://www.sketch.com/s/xyz123'
},
};
Embed images
This feature allows you to embed image files into your Storybook stories. By providing a URL to the image, you can display the design alongside the component.
import { withDesign } from 'storybook-addon-designs';
export default {
title: 'Button',
decorators: [withDesign],
};
export const Primary = () => <button>Primary</button>;
Primary.parameters = {
design: {
type: 'image',
url: 'https://example.com/design.png'
},
};
storybook-addon-a11y helps you test the accessibility of your components. It provides tools to check for accessibility issues, whereas @storybook/addon-designs is focused on embedding design resources.
A Storybook addon that embed Figma or websites in the addon panel for better design-development workflow.
This addon should work well with any framework. If you find that the addon does not work, please open an issue.
npm install -D @storybook/addon-designs
yarn add -D @storybook/addon-designs
pnpm add -D @storybook/addon-designs
main.js
export default {
addons: ["@storybook/addon-designs"],
};
export default {
title: "My stories",
component: Button,
};
export const myStory = {
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/LKQ4FJ4bTnCSjedbRpk931/Sample-File",
},
},
};
FAQs
Storybook addon for embedding your design preview in addon panel
The npm package @storybook/addon-designs receives a total of 364,179 weekly downloads. As such, @storybook/addon-designs popularity was classified as popular.
We found that @storybook/addon-designs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We're excited to announce that Socket now supports the Java programming language.
Security News
Socket detected a malicious Python package impersonating a popular browser cookie library to steal passwords, screenshots, webcam images, and Discord tokens.
Security News
Deno 2.0 is now available with enhanced package management, full Node.js and npm compatibility, improved performance, and support for major JavaScript frameworks.