How to use @storybook/addon-viewport - 5 common examples

To help you get started, weโ€™ve selected a few @storybook/addon-viewport 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 dfee / rbx / docs / stories / .config / config.ts View on Github external
addDecorator(withInfo());

setOptions({
  name: "๐Ÿ‘Ÿ rbx - Bulma UI",
  showAddonPanel: true,
  url: "https://github.com/dfee/rbx",
});

addDecorator(withKnobs);

configureViewport({
  defaultViewport: "responsive",
  viewports: {
    // tslint:disable:object-literal-sort-keys
    responsive: INITIAL_VIEWPORTS.responsive,
    mobileSmall: {
      name: "Mobile @ 480px",
      styles: {
        width: "480px",
      },
    },
    mobileMax: {
      name: "Mobile @ 768px (max)",
      styles: {
        width: "768px",
      },
    },
    tabletMin: {
      name: "Tablet @ 769px (min)",
      styles: {
        width: "769px",
github kontur-edu / Ulearn / src / Frontend / src / components / comments / CommentSendForm / CommentSendForm.story.js View on Github external
handleSubmit={action("editComment")}
			submitTitle={"ะกะพั…ั€ะฐะฝะธั‚ัŒ"}
			handleCancel={action("cancelComment")}
			commentId={1}
			author={nameOnlyUser}
			sending={false}
		/>
		<h3>ะคะพั€ะผะฐ ะฒ ัะพัั‚ะพัะฝะธะธ ะพั‚ะฟั€ะฐะฒะบะธ</h3>
		
		<h3>ะฃัะฟะตัˆะฝะฐั ะพั‚ะฟั€ะฐะฒะบะฐ ะบะพะผะผะตะฝั‚ะฐั€ะธั ะพั‡ะธั‰ะฐะตั‚ ะฟะพะปะต ะฒะฒะพะดะฐ</h3>
		
		<h3>ะžัˆะธะฑะบะฐ ะฟั€ะธ ะพั‚ะฟั€ะฐะฒะบะต ะบะพะผะผะตะฝั‚ะฐั€ะธั ะะ• ะพั‡ะธั‰ะฐะตั‚ ะฟะพะปะต ะฒะฒะพะดะฐ</h3>
		
	
), {viewport: "desktop"})
.addDecorator(withViewport())
.add("tablet", () =&gt; (
	
), {viewport: "tablet"})
.addDecorator(withViewport())
.add("mobile", () =&gt; (
	
), {viewport: "mobile"});
github react-component / select / storybook / index.js View on Github external
import Multiple from '../examples/multiple';
import Optgroup from '../examples/optgroup';
import OptionFilterProp from '../examples/optionFilterProp';
import OptionLabelProp from '../examples/optionLabelProp';
import SingleAnimation from '../examples/single-animation';
import Single from '../examples/single';
import Suggest from '../examples/suggest';
import Tags from '../examples/tags';
import UpdateOption from '../examples/update-option';
import READMECode from '../README.md';

storiesOf('rc-select', module)
  .addDecorator(checkA11y)
  .addDecorator(withInfo)
  .addDecorator((storyFn, context) =&gt; withConsole()(storyFn)(context))
  .addDecorator(withViewport())
  .add(
    'README',
    () =&gt; (
      <div style="{{">
        
      </div>
    ),
    {
      source: {
        code: READMECode,
      },

@storybook/addon-viewport

Build responsive components by adjusting Storybookโ€™s viewport size and orientation

MIT
Latest version published 13 days ago

Package Health Score

95 / 100
Full package analysis