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

@formepdf/tailwind

v0.9.1

Published

Tailwind CSS class support for Forme PDF templates

Readme

@formepdf/tailwind

Style Forme PDF components with Tailwind CSS utility classes.

npm install @formepdf/tailwind
import { tw } from '@formepdf/tailwind';
import { Document, Page, View, Text } from '@formepdf/react';

<Document>
  <Page size="Letter" margin={54}>
    <View style={tw("flex-row items-center justify-between p-6 bg-slate-100 rounded-lg")}>
      <Text style={tw("text-2xl font-bold text-slate-900")}>Invoice #001</Text>
      <Text style={tw("text-sm text-slate-500")}>March 2026</Text>
    </View>
  </Page>
</Document>

tw() parses a space-separated string of Tailwind classes and returns a plain style object. Unknown classes are silently ignored. When classes conflict, the last one wins.

tw("p-4 text-lg font-bold text-blue-500")
// → { padding: 16, fontSize: 18, fontWeight: 700, color: '#3b82f6' }

Supported classes

Spacingp-{n}, px-{n}, py-{n}, pt-{n}, m-{n}, mx-{n}, mx-auto, space-y-{n}, space-x-{n}, negative values (-mt-4), p-px

Typographytext-xs through text-9xl, font-thin through font-black, italic, text-left/center/right/justify, leading-*, tracking-*, underline, line-through, uppercase, lowercase, capitalize

Colors — Full Tailwind palette (slate, gray, red, blue, etc.) with shades 50–950: text-{color}-{shade}, bg-{color}-{shade}, border-{color}-{shade}

Layoutflex-row, flex-col, items-*, justify-*, self-*, flex-1, flex-wrap, gap-{n}

Dimensionsw-{n}, h-{n}, w-full, w-auto, w-1/2, min-w-{n}, max-w-{n}

Gridgrid, grid-cols-{n}, col-span-{n}, col-start-{n}, row-span-{n}

Bordersborder, border-{n}, border-t, rounded, rounded-lg, rounded-full

Otherrelative, absolute, top-{n}, overflow-hidden, opacity-{n}

Arbitrary valuesw-[200], text-[14px], p-[20], text-[#333], bg-[#ff0000]

Auto margins

Horizontal centering with mx-auto:

<View style={tw("mx-auto w-64")}>
  <Text>Centered content</Text>
</View>

Also supports my-auto, mt-auto, mr-auto, mb-auto, ml-auto, m-auto.

TypeScript

tw() returns a FormeStyle compatible with Forme component style props — no type casting needed:

import { tw, type FormeStyle } from '@formepdf/tailwind';

const style: FormeStyle = tw("p-4 bg-white rounded-lg");

What's not supported

Tailwind features that don't apply to PDF rendering: responsive prefixes (sm:, md:), state variants (hover:, focus:), dark mode, z-index, aspect-ratio.

Docs

Full documentation: docs.formepdf.com/tailwind