Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@storybook/angular

Package Overview
Dependencies
Maintainers
12
Versions
1926
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/angular

Storybook for Angular: Develop Angular components in isolation with hot reloading.

  • 8.4.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
295K
decreased by-2.18%
Maintainers
12
Weekly downloads
 
Created

What is @storybook/angular?

@storybook/angular is a tool for developing UI components in isolation for Angular applications. It allows developers to build, test, and showcase components independently from the main application, which helps in creating a more modular and maintainable codebase.

What are @storybook/angular's main functionalities?

Component Development

Allows developers to create and showcase individual components in isolation. This example demonstrates how to create a story for a Button component.

import { moduleMetadata, storiesOf } from '@storybook/angular';
import { ButtonComponent } from './button.component';

storiesOf('Button', module)
  .addDecorator(
    moduleMetadata({
      declarations: [ButtonComponent],
    })
  )
  .add('default', () => ({
    component: ButtonComponent,
    props: {
      text: 'Click me',
    },
  }));

Interactive Stories

Enables the creation of interactive stories where components can respond to user actions. This example shows a Button component that displays an alert when clicked.

import { moduleMetadata, storiesOf } from '@storybook/angular';
import { ButtonComponent } from './button.component';

storiesOf('Button', module)
  .addDecorator(
    moduleMetadata({
      declarations: [ButtonComponent],
    })
  )
  .add('with click action', () => ({
    component: ButtonComponent,
    props: {
      text: 'Click me',
      onClick: () => alert('Button clicked!'),
    },
  }));

Addons Integration

Supports integration with various addons to enhance the development experience. This example uses the Knobs addon to dynamically change the text of the Button component.

import { moduleMetadata, storiesOf } from '@storybook/angular';
import { withKnobs, text } from '@storybook/addon-knobs';
import { ButtonComponent } from './button.component';

storiesOf('Button', module)
  .addDecorator(withKnobs)
  .addDecorator(
    moduleMetadata({
      declarations: [ButtonComponent],
    })
  )
  .add('with knobs', () => ({
    component: ButtonComponent,
    props: {
      text: text('Text', 'Click me'),
    },
  }));

Other packages similar to @storybook/angular

Keywords

FAQs

Package last updated on 20 Nov 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc