Socket
Socket
Sign inDemoInstall

@storybook/html

Package Overview
Dependencies
Maintainers
11
Versions
1666
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/html


Version published
Weekly downloads
145K
increased by3.82%
Maintainers
11
Created
Weekly downloads
 

Package description

What is @storybook/html?

@storybook/html is a tool for developing UI components in isolation for HTML-based projects. It allows developers to build, test, and showcase their components in a structured and interactive environment.

What are @storybook/html's main functionalities?

Component Development

This feature allows developers to create and display different states of a component. The code sample demonstrates how to create stories for a Button component with different content.

import { storiesOf } from '@storybook/html';

storiesOf('Button', module)
  .add('with text', () => '<button>Hello Button</button>')
  .add('with emoji', () => '<button>😀 😎 👍 💯</button>');

Interactive Addons

This feature allows the use of addons to make stories interactive. The code sample shows how to use the Knobs addon to dynamically change the text of a Button component.

import { storiesOf } from '@storybook/html';
import { withKnobs, text } from '@storybook/addon-knobs';

storiesOf('Button', module)
  .addDecorator(withKnobs)
  .add('with dynamic text', () => {
    const label = text('Label', 'Hello Button');
    return `<button>${label}</button>`;
  });

Documentation

This feature allows developers to add documentation to their stories. The code sample demonstrates how to use the storybook-readme addon to include markdown documentation for a Button component.

import { storiesOf } from '@storybook/html';
import { withDocs } from 'storybook-readme';
import ButtonReadme from './Button.md';

storiesOf('Button', module)
  .addDecorator(withDocs(ButtonReadme))
  .add('default', () => '<button>Hello Button</button>');

Other packages similar to @storybook/html

Changelog

Source

8.1.6

  • CLI: Only log the UpgradeStorybookToSameVersionError but continue the upgrade as normal - #27217, thanks @kasperpeulen!
  • Core: Replace ip function with a small helper function to address security concerns - #27529, thanks @tony19!
  • Tags: Fix unsafe project-level tags lookup - #27511, thanks @shilman!
  • Vite: Fix stats-plugin to normalize file names with posix paths - #27218, thanks @AlexAtVista!

Readme

Source

Storybook HTML Renderer

Keywords

FAQs

Last updated on 05 Jun 2024

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