Socket
Socket
Sign inDemoInstall

@storybook/vue3

Package Overview
Dependencies
Maintainers
11
Versions
1190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/vue3

Storybook Vue 3 renderer


Version published
Weekly downloads
306K
increased by6.08%
Maintainers
11
Weekly downloads
 
Created

What is @storybook/vue3?

@storybook/vue3 is a tool for developing UI components in isolation for Vue 3 applications. It allows developers to build, test, and document components in a standalone environment, which helps in creating robust and reusable components.

What are @storybook/vue3's main functionalities?

Component Development

Allows developers to create and showcase different states of Vue 3 components in isolation.

import { storiesOf } from '@storybook/vue3';
import MyButton from './MyButton.vue';

storiesOf('MyButton', module)
  .add('default', () => ({
    components: { MyButton },
    template: '<my-button>Default</my-button>',
  }))
  .add('primary', () => ({
    components: { MyButton },
    template: '<my-button primary>Primary</my-button>',
  }));

Interactive Documentation

Enables the creation of interactive documentation for components, allowing users to see how components behave with different props and states.

import { Meta, Story } from '@storybook/vue3';
import MyButton from './MyButton.vue';

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

const Template: Story = (args) => ({
  components: { MyButton },
  setup() {
    return { args };
  },
  template: '<my-button v-bind="args" />',
});

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

Add-ons Support

Supports various add-ons to enhance the development experience, such as knobs for dynamic prop editing.

import { withKnobs, text, boolean } from '@storybook/addon-knobs';
import MyButton from './MyButton.vue';

export default {
  title: 'MyButton',
  decorators: [withKnobs],
};

export const withKnobsExample = () => ({
  components: { MyButton },
  props: {
    label: {
      type: String,
      default: text('Label', 'Button'),
    },
    primary: {
      type: Boolean,
      default: boolean('Primary', false),
    },
  },
  template: '<my-button :primary="primary">{{ label }}</my-button>',
});

Other packages similar to @storybook/vue3

Keywords

FAQs

Package last updated on 14 Oct 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