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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-tanstack-widget

v0.1.2

Published

React widget using TanStack Router and TanStack Query

Downloads

6

Readme

React TanStack Widget

A React widget component library that integrates TanStack Router, TanStack Query, and Tailwind CSS for building embeddable widgets.

Features

  • Built with React, TypeScript, TanStack Router, and TanStack Query
  • Styled with Tailwind CSS for modern, responsive design
  • Easily embeddable in any React application
  • Customizable theming
  • Built-in routing with TanStack Router
  • Data fetching with TanStack Query
  • Fully typed API with TypeScript

Installation

npm install react-tanstack-widget

or

yarn add react-tanstack-widget

Requirements

Important: This widget uses Tailwind CSS for styling. To use this widget in your application, you need to:

  1. Install Tailwind CSS in your host application:
npm install tailwindcss
  1. Configure Tailwind in your project:
npx tailwindcss init
  1. Make sure your Tailwind configuration includes the widget's styles:
// tailwind.config.js
module.exports = {
  content: [
    "./src/**/*.{js,jsx,ts,tsx}",
    "./node_modules/react-tanstack-widget/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
};

Usage

Basic Usage

import React from "react";
import { Widget } from "react-tanstack-widget";

const App = () => {
  return (
    <div className="app">
      <h1>My Application</h1>

      {/* Basic widget implementation */}
      <Widget instanceId="my-widget-1" />
    </div>
  );
};

Custom Theme

You can customize the appearance of the widget by providing a theme object:

import React from "react";
import { Widget } from "react-tanstack-widget";

const App = () => {
  return (
    <div className="app">
      <h1>My Application</h1>

      {/* Widget with custom theme */}
      <Widget
        instanceId="my-widget-2"
        theme={{
          primaryColor: "#ff6b6b",
          secondaryColor: "#4ecdc4",
          fontFamily: "Roboto, sans-serif",
        }}
      />
    </div>
  );
};

With Initial Data

You can pass initial data to the widget:

import React from "react";
import { Widget } from "react-tanstack-widget";

const App = () => {
  return (
    <div className="app">
      <h1>My Application</h1>

      {/* Widget with initial data */}
      <Widget
        instanceId="my-widget-3"
        initialData={{
          customerId: "12345",
          preferences: {
            language: "en-US",
            currency: "USD",
          },
        }}
      />
    </div>
  );
};

Styling with Tailwind CSS

The widget is built with Tailwind CSS utility classes. You can use the theme customization to change the primary and secondary colors, as well as the font family. The widget will automatically apply these styles to its components.

<Widget
  instanceId="styled-widget"
  theme={{
    primaryColor: "#8b5cf6", // Purple
    secondaryColor: "#06b6d4", // Cyan
    fontFamily: "Poppins, sans-serif",
  }}
/>

API Reference

Widget Props

| Prop | Type | Required | Description | | -------------------- | ------ | -------- | ----------------------------------------- | | instanceId | string | Yes | Unique identifier for the widget instance | | initialData | object | No | Initial data to pass to the widget | | theme | object | No | Custom theme settings | | theme.primaryColor | string | No | Primary color for the widget | | theme.secondaryColor | string | No | Secondary color for the widget | | theme.fontFamily | string | No | Font family for the widget text |

Development

  1. Clone this repository
  2. Install dependencies: npm install
  3. Start the development server: npm run dev
  4. Build the library: npm run build

Publishing

To publish a new version to npm:

  1. Update the version in package.json
  2. Build the library: npm run build
  3. Publish to npm: npm publish

License

MIT