Norwegian Polka Music

    @vivliostyle/react
    TypeScript icon, indicating that this package has built-in type declarations

    2.22.2 • Public • Published

    React Vivliostyle

    NPM

    Use React component as a Vivliostyle renderer.

    Install

    yarn add @vivliostyle/react

    Use

    import React from "react";
    
    import { Renderer } from "@vivliostyle/react";
    
    function App() {
      const [page, setPage] = React.useState(1);
    
      function next() {
        setPage((page) => page + 1);
      }
    
      function prev() {
        setPage((page) => page - 1);
      }
    
      function onLoad(state) {
        console.log(state.epageCount, state.docTitle);
      }
    
      const sample =
        "https://vivliostyle.github.io/vivliostyle_doc/samples/gon/index.html";
    
      return (
        <div>
          <Renderer source={sample} page={page} onLoad={onLoad} />
          <button onClick={next}>Next</button>
          <button onClick={prev}>Prev</button>
        </div>
      );
    }

    Run yarn storybook to see the Storybook.

    Install

    npm i @vivliostyle/react

    DownloadsWeekly Downloads

    231

    Version

    2.22.2

    License

    AGPL-3.0

    Unpacked Size

    66.5 kB

    Total Files

    10

    Last publish

    Collaborators

    • mshinyu
    • uetchy
    • akabeko
    • youchan
    • spring-raining
    • johanneswilm
    • yamasy1549