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

@webflow/tsw

v0.13.0

Published

The .tsw toolchain in one package: the authoring API and runtime, the element library, the language engine and compiler, framework adapters for Astro, Next.js, and React, and the TypeScript editor plugin.

Readme

@webflow/tsw

Tooling for building Webflow sites in code. Pages and components are written in .tsw, a TypeScript dialect of TSX, and render through Astro, Next.js, or React.

npm install @webflow/tsw@next

A component

// src/components/WindowBar.tsw
import {component, props, style} from '@webflow/tsw/core';
import {Block, Span} from '@webflow/tsw/ui';

const bar = style('window-bar', {display: 'flex', alignItems: 'center', gap: '8px'});

export default component({name: 'WindowBar', props: {title: props.Text({defaultValue: ''})}}, ({title}) => (
  <Block class={bar}>
    <Span>{title}</Span>
  </Block>
));

Set up your framework

// astro.config.mjs
import {defineConfig} from 'astro/config';
import react from '@astrojs/react';
import webflow from '@webflow/tsw/astro';

export default defineConfig({integrations: [react(), webflow()]});
// next.config.mjs
import {withWebflow} from '@webflow/tsw/next/config';

export default withWebflow({
  // your own Next config is preserved
});
// vite.config.ts (plain React)
import {defineConfig} from 'vite';
import {webflowReactVite} from '@webflow/tsw/react/vite';

export default defineConfig({plugins: [webflowReactVite()]});

Links between pages in Astro

Import the target page and pass it to Link:

import About from './about.tsw';
import {Link} from '@webflow/tsw/ui';

<Link to={About}>About</Link>;

The Astro integration resolves static .tsw routes automatically—no middleware file is needed. It uses Astro's resolved route manifest, including base and trailingSlash, and updates the mapping when routes change during development. The same mapping works during prerendering.

Dynamic routes have no single URL. For dynamic parameters, custom routing, or request-dependent locale selection, supply your own resolver on Astro.locals.pageHref. An explicit resolver replaces the default mapping; null resets it. An unmapped page reference throws rather than silently linking to the wrong page.

Check

npx tsw check src

Add the TypeScript plugin for inline diagnostics and quick fixes in any tsserver-based editor:

// tsconfig.json
{
  "compilerOptions": {
    "plugins": [{"name": "@webflow/tsw/typescript"}],
  },
}

Entry points

| Import | What it is | | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | @webflow/tsw/core | Authoring API used inside .tsw files: component(), page(), style(), props.* | | @webflow/tsw/core/theme, /stdlib, /i18n | Theme modules, the typed stdlib, and locale bindings | | @webflow/tsw/ui | The element library (Block, Section, Heading, forms, tabs, ...) | | @webflow/tsw/astro, /next, /react | Framework adapters: Astro integration, Next.js config wrapper and LocaleBoundary, React renderer with a Vite plugin | | @webflow/tsw/compiler, /compiler/vite | The compiler API, the Vite plugin, and the tsw CLI | | @webflow/tsw/typescript | tsserver plugin: add {"name": "@webflow/tsw/typescript"} to compilerOptions.plugins | | @webflow/tsw/lang | The language engine, for tools that analyze .tsw |

@webflow/tsw/runtime (styles and locale context) and @webflow/tsw/cms (CMS reads) are emit targets for compiled modules; authors never import them. The Astro integration also exports defaultPageHref from @webflow/tsw/astro, which compiled Astro pages use for automatic route resolution.

The published package supports Node.js 22.13.0 and newer, the same floor as the published @webflow/webflow-cli. Building this repository requires Node.js 22.23.5 or newer for its development tools.

Peer dependencies: react and typescript are required. astro, next, and vite are optional and only needed by the entry that uses them.