Socket
Socket
Sign inDemoInstall

@storybook/blocks

Package Overview
Dependencies
24
Maintainers
29
Versions
670
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/blocks


Version published
Maintainers
29
Created

Package description

What is @storybook/blocks?

@storybook/blocks is a package designed to enhance the Storybook experience by providing a set of reusable blocks for building and organizing stories. It allows developers to create more structured and maintainable storybooks with ease.

What are @storybook/blocks's main functionalities?

Creating Stories

This feature allows you to create and organize stories for your components. The code sample demonstrates how to define a story for a Button component using the Story and Meta blocks.

import { Story, Meta } from '@storybook/blocks';

export default {
  title: 'Example/Button',
  component: Button,
} as Meta;

const Template: Story<ButtonProps> = (args) => <Button {...args} />;

export const Primary = Template.bind({});
Primary.args = {
  primary: true,
  label: 'Button',
};

Adding Controls

This feature allows you to add controls to your stories, enabling dynamic interaction with component properties. The code sample shows how to add a color control for the backgroundColor property of a Button component.

import { Story, Meta } from '@storybook/blocks';

export default {
  title: 'Example/Button',
  component: Button,
  argTypes: {
    backgroundColor: { control: 'color' },
  },
} as Meta;

const Template: Story<ButtonProps> = (args) => <Button {...args} />;

export const Primary = Template.bind({});
Primary.args = {
  primary: true,
  label: 'Button',
};

Documentation

This feature allows you to add documentation to your stories, making it easier for other developers to understand and use your components. The code sample demonstrates how to configure documentation for a Button component using DocsPage and DocsContainer.

import { Meta, Story, DocsPage, DocsContainer } from '@storybook/blocks';

export default {
  title: 'Example/Button',
  component: Button,
  parameters: {
    docs: {
      container: DocsContainer,
      page: DocsPage,
    },
  },
} as Meta;

const Template: Story<ButtonProps> = (args) => <Button {...args} />;

export const Primary = Template.bind({});
Primary.args = {
  primary: true,
  label: 'Button',
};

Other packages similar to @storybook/blocks

Changelog

Source

7.0.0-alpha.10 (July 2, 2022)

Features

  • Addon-docs: Include Vue methods in ArgsTable (#18609)
  • UI: Fix default theme according to preferred color scheme (#17311)
  • Storyshots: Add SnapshotsWithOptionsArgType (#15712)
  • Controls: Add max length config to text control (#14396)

Bug Fixes

  • CLI/HTML: Improve HTML typescript stories (#18618)
  • Controls: Throttle color controls and make updateArgs and resetArgs stable (#18335)
  • Controls: Silence unexpected control type enum for color matchers (#16334)
  • UI: Stop add-on Draggable from overlapping the vertical scrollbar when stories overflow (#17663)
  • React: Fix source snippet decorator for story functions with suspense (#17915)
  • Core: Avoid logging an object on compilation errors (#15885)
  • UI: Fix router handling of URLs containing "settings" (#16245)
  • UI: Fix viewMode handling on navigation (#16912)
  • UI: Fix loading title (#17935)

Maintenance

  • Examples/Vue: Fix missing a vue-template-compiler dependency (#17485)
  • Fix homepage core-server (#18121)
  • UI: Replace references to themes.normal with themes.light (#17034)

Dependency Upgrades

  • Upgrade file-system-cache to 2.0.0 and remove custom types (#18253)
  • Security: Update x-default-browser and fix issue with package. (#18277)
  • Update puppeteer dependencies version (#15163)
  • Upgrade react-syntax-highlighter to v15.5.0 (#18009)

Readme

Source

Storybook Doc Blocks

Portable documentation components for building design systems in Storybook.

Blocks development

To bootstrap, in the monorepo root:

yarn && yarn bootstrap --core

To develop this package, in the monorepo root:

yarn build blocks --watch

To run storybook, in this directory:

yarn storybook

Keywords

FAQs

Last updated on 02 Jul 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc