npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@minitype/tsx

v0.1.2

Published

JSX/TSX support for minitype

Readme

@minitype/tsx

minitype の文書を JSX/TSX で記述するためのパッケージです. JSX ランタイムと,ブロック・インライン・標準プラグインに対応するコンポーネント群を提供します.

@minitype/tsx is a JSX/TSX support package for minitype. It provides a set of components and a JSX runtime for writing typesetting documents in JSX syntax.

セットアップ

  1. @minitype/tsx をインストールします.
# npm
npm install @minitype/tsx

# Yarn
yarn add @minitype/tsx
  1. tsconfig.json に JSX の設定を追加します.
{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "@minitype/tsx"
  }
}

使い方

.tsx ファイルに JSX を使って組版ドキュメントを記述します.

<Document> をルート要素として,その中に <Group>(グループ)を配置します. グループの中にブロック要素を配置して,ブロック要素の中にインライン要素を配置します.

最後に minitypeJSX() へ渡すことで PDF を出力します. minitypeJSX の第 2 引数(MiniTypeOptions)および返り値は通常の minitype 関数と同一です.

詳細なコンポーネントについては コンポーネント一覧 を,実際の使用例については sample/index.tsx を参照してください.

import { cmyk } from "@minitype/minitype";
import {
  B, Caption, Cell, Code, Color, Document, Fn, Footnote, Group,
  H1, H2, Image, Li1, Li2, MathBlock, minitypeJSX,
  Ol1, Ol2, P, Row, Ruby, Table, Url,
} from "@minitype/tsx";

const document = (
  <Document style={{ size: { width: 210, height: 297 }, writingMode: "horizontal" }}>
    <Group>
      <H1>minitype</H1>

      <H2>テキストとインライン要素</H2>
      <P>
        minitype は PDF 組版エンジンです<Fn label="fn-1" />.
        <B>太字</B>や<Color value={cmyk(0, 100, 100, 0)}>赤色テキスト</Color>,
        <Ruby ruby="くみはん">組版</Ruby>等のインライン要素を使用できます.
        詳細は<Url href="https://typeset.jp">公式サイト</Url>をご覧ください.
      </P>
      <Footnote label="fn-1">
        Node.js 上で動作して,PDF を直接出力します.
      </Footnote>

      <H2>リスト</H2>
      <Li1>順序なしリスト(第 1 レベル)</Li1>
      <Li2>順序なしリスト(第 2 レベル)</Li2>
      <Ol1>順序付きリスト(第 1 項目)</Ol1>
      <Ol2>順序付きリスト(第 2 レベル)</Ol2>

      <H2>コードブロック,数式</H2>
      <Code lang="ts">const result = minitypeJSX(document);</Code>
      <MathBlock>{"E = mc^2"}</MathBlock>

      <H2>テーブル</H2>
      <Table>
        <Row>
          <Cell><P>名前</P></Cell>
          <Cell><P>説明</P></Cell>
        </Row>
        <Row>
          <Cell><P>minitype</P></Cell>
          <Cell><P>PDF 組版エンジン</P></Cell>
        </Row>
      </Table>

      <H2>画像とキャプション</H2>
      <Image src="figure.png" style={{ width: 80 }} />
      <Caption>サンプル画像</Caption>
    </Group>
  </Document>
);

await minitypeJSX(document, { fontDir: "./fonts" }).save("output.pdf");

ライセンス・謝辞

Copyright (c) 2026 Yuto Wada. This software is released under the MIT License, see LICENSE.

本ソフトウェアは,2025 年度下期 未踏アドバンスト事業の支援を受けて開発されました.