Security News
Python Overtakes JavaScript as Top Programming Language on GitHub
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
@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
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.
Security News
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
Security News
Dutch National Police and FBI dismantle Redline and Meta infostealer malware-as-a-service operations in Operation Magnus, seizing servers and source code.
Research
Security News
Socket is tracking a new trend where malicious actors are now exploiting the popularity of LLM research to spread malware through seemingly useful open source packages.