fbredius/storybook

View on GitHub
docs/snippets/angular/your-component.ts.mdx

Summary

Maintainability
Test Coverage
```ts
// YourComponent.stories.ts

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


import { YourComponent } from './your.component';

//πŸ‘‡ This default export determines where your story goes in the story list
export default {
  /* πŸ‘‡ The title prop is optional.
  * See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
  * to learn how to generate automatic titles
  */
  title: 'YourComponent',
  component: YourComponent,
} as Meta;

//πŸ‘‡ We create a β€œtemplate” of how args map to rendering
const Template: Story = (args) => ({
  props:args,
});

export const FirstStory = Template.bind({});
FirstStory.args= {
 //πŸ‘‡ The args you need here will depend on your component
};
```