All Projects → Quramy → Zisui

Quramy / Zisui

Licence: mit
Yet another CLI to screenshot your Storybook

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Zisui

Storycap
A Storybook Addon, Save the screenshot image of your stories 📷 via puppeteer.
Stars: ✭ 451 (+526.39%)
Mutual labels:  screenshot, storybook
Ifme
Free, open source mental health communication web app to share experiences with loved ones
Stars: ✭ 1,147 (+1493.06%)
Mutual labels:  storybook
Docs
The API for generating high quality images from HTML/CSS.
Stars: ✭ 49 (-31.94%)
Mutual labels:  screenshot
Lypaymentfield
多种风格的支付框控件,可定制加密图片,也可使用带动画的弹窗。A variety of styles of payment box controls can be customized to encrypt pictures, can also be used with animated alert.
Stars: ✭ 58 (-19.44%)
Mutual labels:  screenshot
Kohei.dev
🌎 A Production-level Single Page App with Server Side Rendering
Stars: ✭ 50 (-30.56%)
Mutual labels:  storybook
Blazerat
🔥 Control your Linux home computer with telegram bot.
Stars: ✭ 60 (-16.67%)
Mutual labels:  screenshot
Dark Mode Screenshot
This Puppeteer script takes a 📷 screenshot of a webpage in 🌞 Light and 🌒 Dark Mode.
Stars: ✭ 47 (-34.72%)
Mutual labels:  screenshot
Secstory
SecStory (Security Story) adalah buku digital yang berisi kumpulan donasi cerita, ditulis oleh para pemangku kepentingan keamanan siber di Indonesia.
Stars: ✭ 71 (-1.39%)
Mutual labels:  storybook
Page2image
📷 page2image is a npm package for taking screenshots which also provides CLI command
Stars: ✭ 66 (-8.33%)
Mutual labels:  screenshot
Storybook Zeplin
Storybook addon to view Zeplin resources in story panel
Stars: ✭ 53 (-26.39%)
Mutual labels:  storybook
Foxshot
Capture web page screenshots using headless Firefox!
Stars: ✭ 52 (-27.78%)
Mutual labels:  screenshot
Gatsby Starter Typescript Deluxe
A Gatsby starter with TypeScript, Storybook, Styled Components, Framer Motion, Jest, and more.
Stars: ✭ 50 (-30.56%)
Mutual labels:  storybook
Loki
👁 Visual Regression Testing for Storybook
Stars: ✭ 1,109 (+1440.28%)
Mutual labels:  storybook
Grabzit
GrabzIt enables you to convert HTML and URL's into JPG's, PNG's, DOCX's, PDF's and more. Transform online videos into animated GIF's or convert HTML tables to JSON, CSV and Excel spreadsheets.
Stars: ✭ 49 (-31.94%)
Mutual labels:  screenshot
Imgursniper
📷 A quick and easy Image, Screenshot and Screen recording sharing tool
Stars: ✭ 69 (-4.17%)
Mutual labels:  screenshot
Yaxg
capture and record your screen with callbacks
Stars: ✭ 47 (-34.72%)
Mutual labels:  screenshot
Fakescreenshot
🔥对抗假消息系列项目之一:截屏 = 实锤?相信你就输了!(”突破性“更新💥:支持修改任何网站!)
Stars: ✭ 1,058 (+1369.44%)
Mutual labels:  screenshot
Matchbox
🔥 A react UI component library
Stars: ✭ 58 (-19.44%)
Mutual labels:  storybook
Gp Vue Boilerplate
Grabarz & Partner Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites with vuejs.
Stars: ✭ 71 (-1.39%)
Mutual labels:  storybook
Textshot
Python tool for grabbing text via screenshot
Stars: ✭ 1,163 (+1515.28%)
Mutual labels:  screenshot

This repository is not maintained. zisui was integrated into https://github.com/reg-viz/storycap. And migration to Storycap is so easy. Please read our migration guide

zisui npm version CircleCI

A fast and simple CLI to screenshot your Storybook.

asciicast

Install

$ npm install zisui

How to use

zisui runs with 2 modes. One is "simple" and another is "managed".

With the simple mode, you don't need to configure your Storybook. Give an URL, such as:

$ zisui http://localhost:9001

You can launch your server via --serverCmd option.

$ zisui --serverCmd "start-storybook -p 9001" http://localhost:9001

Also, zisui can crawls built and hosted Storybook pages:

$ zisui https://release-5-0--storybooks-vue.netlify.com

Managed mode

If you want to control how stories are captured (timing or size or etc...), use managed mode.

First, you need to register zisui Storybook addon.

/* .storybook/addons.js */

import "zisui/register";

Next, use withScreenshot decorator to tell how zisui captures your stories.

/* .storybook/config.js */
import { addDecorator } from "@storybook/react";
import { withScreenshot } from "zisui";

addDecorator(withScreenshot());

And you can overwrite the global screenshot options by decorating to specific stories.

storiesOf('SomeKind', module)
.addDecorator(withScreenshot({
  viewport: {
    width: 600,
    height: 400,
  },
 }))
.add('a story', () => /* your story component */);

Note

Now, the withScreenshot decorator supports React only.

CLI options

usage: zisui [options] storybook_url

Options:
  --help                       Show help                                                                       [boolean]
  --version                    Show version number                                                             [boolean]
  --outDir, -o                 Output directory.                                   [string] [default: "__screenshots__"]
  --parallel, -p               Number of browsers to screenshot.                                   [number] [default: 4]
  --flat, -f                   Flatten output filename.                                       [boolean] [default: false]
  --include, -i                Including stories name rule.                                        [array] [default: []]
  --exclude, -e                Excluding stories name rule.                                        [array] [default: []]
  --viewport, -V               Default viewport.                                           [string] [default: "800x600"]
  --disableCssAnimation        Disable CSS animation and transition.                           [boolean] [default: true]
  --silent                                                                                    [boolean] [default: false]
  --verbose                                                                                   [boolean] [default: false]
  --serverCmd                  Command line to launch Storybook server.                           [string] [default: ""]
  --serverTimeout              Timeout [msec] for starting Storybook server.                   [number] [default: 20000]
  --captureTimeout             Timeout [msec] for capture a story.                              [number] [default: 5000]
  --captureMaxRetryCount       Number of count to retry to capture.                                [number] [default: 3]
  --metricsWatchRetryCount     Number of count to retry until browser metrics stable.           [number] [default: 1000]
  --viewportDelay              Delay time [msec] between changing viewport and capturing.        [number] [default: 300]
  --reloadAfterChangeViewport  Whether to reload after viewport changed.                      [boolean] [default: false]

Examples:
  zisui http://localshot:9009
  zisui http://localshot:9009 -i "some-kind/a-story"
  zisui http://example.com/your-storybook -e "**/default" -V iPad
  zisui --serverCmd "start-storybook -p 3000" http://localshot:3000

API

function withScreenshot

withScreenshot(opt?: ScreenShotOptions): Function;

A Storybook decorator to notify zisui to screenshot stories.

type ScreenShotOptions

type ScreenShotOptions = {
  waitImages?: boolean,         // default true
  delay?: number,               // default 0 msec
  waitFor?: string | Function,  // default ""
  viewport?: string | {
    width: number,              // default 800
    height: number,             // default 600
  },
  fullPage?: boolean,           // default true
  skip?: boolean,               // default false
}
  • viewport: If you set a string parameter, it must be included Puppeteer's device descriptors.
  • waitFor : Sometimes you want control the timing to screenshot. If you set a function to return Promise, zisui waits the promise is resolved. Also you can set global function name to this.
<!-- .storybook/preview-head.html -->
<script>
  function myWait() {
    return new Promise(res => setTimeout(res, 5000));
  }
</script>
withScreenshot({ waitFor: "myWait" }); // wait for 5 seconds.

Storybook version compatible

zisui is tested with the followings versions:

  • Simple mode:
    • [x] Storybook v4.x
    • [x] Storybook v5.x
  • Managed mode:
    • [x] Storybook v4.x
    • [x] Storybook v5.x

See also packages in examples directory.

How it works?

zisui is a crawler using Puppeteer.

How to contribute?

PR's are welcome 😄

See CONTRIBUTING if you want more detail.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].