
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@contentful/experience-builder-storybook-addon
Advanced tools
Develop Contentful experience builder components with storybook
Develop experience builder components with storybook
Experience Builder is currently in a private alpha and not available publicly. If you are interested in participating in the alpha, please reach out to your Contentful account team.
This folder contains the source code for the experience builder storybook plugin that allows developers to more efficiently build custom experience builder components. With this plugin developers can visually see how their various component definition options translate to a different UI for their editors.
npm install @contentful/experience-builder-storybook-addon
This guide assumes you already have Experience Builder configured in your application and space. If you don't, please contact your Contentful representative for instructions on how to do so.
In your .storybook/main.ts
file add the plugin into the addons section of the Storybook configuration:
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@contentful/experience-builder-storybook-addon', // <- add storybook plugin here
],
// ... additional config
};
Once the plugin is enabled, you can then hook up your component definition to a storybook layout with the experienceBuilder
Storybook parameter
stories/button.stories.tsx
import type { Meta, StoryObj } from '@storybook/react';
import Button from '../components/atoms/Button';
const meta = {
title: 'Example/Button',
component: Button,
parameters: {
// Required to view component definition changes in Storybook
experienceBuilder: Button.ComponentDefinition,
},
} satisfies Meta<typeof Button>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
targetUrl: '/en',
variant: 'default',
label: 'Button',
},
};
After the parameter for the component has been imported, changes to the component's ComponentDefinition will be visible live on the Storybook instance as such:
FAQs
Develop Contentful experience builder components with storybook
The npm package @contentful/experience-builder-storybook-addon receives a total of 247 weekly downloads. As such, @contentful/experience-builder-storybook-addon popularity was classified as not popular.
We found that @contentful/experience-builder-storybook-addon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 176 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.