How to use the @storybook/angular.storiesOf function in @storybook/angular

To help you get started, we’ve selected a few @storybook/angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sean-perkins / fitness-dashboard-prototype / libs / ui / src / components / typography / label / label.stories.ts View on Github external
import { withKnobs } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/angular';

// @ts-ignore
import readme from './readme.md';

storiesOf('Typography|Label', module)
    .addDecorator(withKnobs)
    .addParameters({
        notes: {
            markdown: readme
        }
    })
    .add('Size/Default', () => ({
        template: `
            The quick brown fox jumps over the lazy dog.
        `
    }))
    .add('Size/Small', () => ({
        template: `
            The quick brown fox jumps over the lazy dog.
        `
    }))
github sean-perkins / fitness-dashboard-prototype / libs / ui / src / components / map / map-hud / map-hud.stories.ts View on Github external
import { centered } from '@storybook/addon-centered/angular';
import { withKnobs } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/angular';

// @ts-ignore
import readme from './readme.md';

storiesOf('Design System|Map/Map HUD', module)
    .addDecorator(withKnobs)
    .addDecorator(centered)
    .addParameters({
        notes: {
            markdown: readme
        }
    })
    .add('Default', () => ({
        template: `
            
        `,
    }));
github marklogic / marklogic-data-hub / web / src / main / ui / app / components / mappings / stories / map-ui.component.stories.ts View on Github external
import {CommonModule} from '@angular/common';
import {RouterModule} from '@angular/router';
import {moduleMetadata, storiesOf} from '@storybook/angular';
import {centered} from '@storybook/addon-centered/angular';
import {boolean, object, text, withKnobs} from '@storybook/addon-knobs';
import {action} from '@storybook/addon-actions';
import {TooltipModule} from 'ngx-bootstrap';
import {StoryCardComponent} from '../../../utils';
import {MapUiComponent, ThemeModule} from "../..";
import {FocusElementDirective} from '../../../directives/focus-element/focus-element.directive';
import {ListFilterPipe} from '../ui/listfilter.pipe';

storiesOf('Components|Mappings', module)
  .addDecorator(withKnobs)
  .addDecorator(
    moduleMetadata({
      imports: [
        CommonModule,
        ThemeModule,
        RouterModule.forRoot([], { useHash: true }),
        TooltipModule.forRoot()
      ],
      schemas: [],
      declarations: [
        MapUiComponent,
        FocusElementDirective,
        ListFilterPipe,
        StoryCardComponent
      ],
github algolia / angular-instantsearch / examples / storybook / src / stories / HitsPerPage.stories.ts View on Github external
import { storiesOf } from '@storybook/angular';
import { wrapWithHits } from '../wrap-with-hits';
import meta from '../meta';

storiesOf('HitsPerPage', module)
  .addDecorator(meta)
  .add('default', () => ({
    component: wrapWithHits({
      template: `
      
      
    `,
    }),
  }))
  .add('with default to 5', () => ({
github IBM / carbon-components-angular / src / dialog / tooltip / tooltip.stories.ts View on Github external
import { storiesOf, moduleMetadata } from "@storybook/angular";
import { action } from "@storybook/addon-actions";
import { withKnobs, text, select } from "@storybook/addon-knobs/angular";

import { InformationFilled16Module } from "@carbon/icons-angular/lib/information--filled/16";
import { DialogModule, PlaceholderModule, DocumentationModule } from "../../";

storiesOf("Components|Tooltip", module)
	.addDecorator(
		moduleMetadata({
			imports: [
				DialogModule,
				PlaceholderModule,
				InformationFilled16Module,
				DocumentationModule
			]
		})
	)
	.addDecorator(withKnobs)
	.add("Basic", () => ({
	template: `
			<div>
				
					<p>This is some tooltip text. This box shows the maximum amount of text that should appear inside.</p></div>
github carbon-design-system / carbon-charts / packages / angular / stories / scatter.stories.ts View on Github external
scatterTimeSeriesData,
	scatterOptions,
	scatterData
} from "../../core/demo/demo-data/index";
import { addWidthAndHeight } from "./commons";

const template = `


`;

const stories = storiesOf("Scatter", module);
stories.add(scatterOptions.title, () =&gt; ({
	template,
	moduleMetadata: {
		imports: [ChartsModule]
	},
	props: {
		data: scatterData,
		options: addWidthAndHeight(scatterOptions)
	}
}));

stories.add(scatterTimeSeriesOptions.title, () =&gt; ({
	template,
	moduleMetadata: {
		imports: [ChartsModule]
	},
github IBM / carbon-components-angular / src / datepicker-input / datepicker-input.stories.ts View on Github external
import { DatePickerInputModule } from "./datepicker-input.module";
import { storiesOf, moduleMetadata } from "@storybook/angular";
import { withKnobs } from "@storybook/addon-knobs/angular";

storiesOf("DatePickerInput", module)
	.addDecorator(
		moduleMetadata({
			imports: [
				DatePickerInputModule
			]
		})
	)
	.addDecorator(withKnobs)
	.add("Simple", () =&gt; ({
		template: `
		
		`
	}));
github IBM / carbon-components-angular / src / input / input.stories.ts View on Github external
import { storiesOf, moduleMetadata } from "@storybook/angular";
import { action } from "@storybook/addon-actions";
import {
	withKnobs,
	text,
	boolean,
	select,
	number
} from "@storybook/addon-knobs/angular";

import { InputModule, DocumentationModule } from "../";

storiesOf("Components|Input", module).addDecorator(
	moduleMetadata({
		imports: [InputModule, DocumentationModule]
	})
)
	.addDecorator(withKnobs)
	.add("Label", () =&gt; ({
		template: `
		
			{{label}}
github Hotell / react-tools-for-better-angular-apps / src / stories / index.stories.ts View on Github external
text: '😀 😎 👍 💯',
      },
    }))
  )
  .add(
    'with some emoji and action',
    withNotes({ text: 'My notes on a button with emojis' })(() => ({
      component: Button,
      props: {
        text: '😀 😎 👍 💯',
        onClick: action('This was clicked OMG'),
      },
    }))
  );

storiesOf('Another Button', module).add('button with link to another story', () => ({
  component: Button,
  props: {
    text: 'Go to Welcome Story',
    onClick: linkTo('Welcome'),
  },
}));
github nitsnets / unicorn_components / src / components / containers / popup / popup.component.demo.ts View on Github external
const moduleMetadata = {
    declarations: [
        UniPopupComponent,
        UniPopupContainerComponent,
        UniIconComponent,
        UniSpinnerComponent,
        UniButtonComponent,
        UniButtonPopupComponent,
        UniButtonGroupComponent,
        UniPopupTriggerDirective
    ]
};
const label = 'Click here!'
const lorem = 'Est labore fugiat irure aliquip laborum minim ea eu in irure pariatur nulla.';

storiesOf('Popup', module)
    .add('Basic', () =&gt; ({
        moduleMetadata, template: `
        
            <p> ${label} </p>
             ${lorem} 
        
    `}))
    .add('Close button', () =&gt; ({
        moduleMetadata, template: `
        
            <p> ${label} </p>
             ${lorem} 
        
    `}))
    .add('Close if click inside', () =&gt; ({
        moduleMetadata, template: `

@storybook/angular

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

MIT
Latest version published 17 days ago

Package Health Score

98 / 100
Full package analysis