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

@squares-app/react

v2.6.0

Published

Official React component for squares.vote embeds

Readme

@squares-app/react

Official React component for embedding squares.vote widgets.

What's New in v2.3.3

🔄 Final Slide Enhancements - Better user control on results screen:

  • Start Over button - Subtle text link to restart the assessment
  • Close button - Second subtle option to dismiss the widget
  • Clean layout - Options separated by bullet point for clarity
  • Resets state - Start Over properly resets all dimensions to defaults
  • Hover feedback - Subtle color change on hover for both options

Installation

npm install @squares-app/react
# or
yarn add @squares-app/react
# or
pnpm add @squares-app/react

Usage

Basic Example

import { SquaresEmbedReact } from '@squares-app/react';

function App() {
  return (
    <div>
      <h1>My Political Views</h1>
      <SquaresEmbedReact variant="card" />
    </div>
  );
}

With Customization

import { SquaresEmbedReact } from '@squares-app/react';

function App() {
  return (
    <SquaresEmbedReact
      variant="card"
      buttonText="Take the Quiz"
      align="center"
      maxWidth="600px"
      primaryColor="#ff6b6b"
      borderRadius="16px"
      shadow={true}
    />
  );
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | variant | 'card' \| 'button' | 'card' | Widget variant | | buttonText | string | 'Map Your Squares' | Custom button text | | align | 'left' \| 'center' \| 'right' | 'center' | Alignment | | maxWidth | string | undefined | Max width (e.g., '600px') | | primaryColor | string | undefined | Custom button color (hex) | | borderRadius | string | undefined | Custom border radius | | shadow | boolean | true | Show/hide shadow |

Features

  • React-first: Built specifically for React applications
  • TypeScript: Full type safety
  • Lifecycle-aware: Properly integrates with React's lifecycle
  • Auto-cleanup: Automatically cleans up on unmount
  • No conflicts: Uses refs to avoid DOM manipulation conflicts
  • SSR-safe: Works with Next.js and other SSR frameworks

Advanced Usage

With Next.js

'use client'; // Required for client components

import { SquaresEmbedReact } from '@squares/react';

export default function MyPage() {
  return <SquaresEmbedReact variant="card" />;
}

Dynamic Props

import { useState } from 'react';
import { SquaresEmbedReact } from '@squares/react';

function App() {
  const [variant, setVariant] = useState<'card' | 'button'>('card');

  return (
    <div>
      <button onClick={() => setVariant(variant === 'card' ? 'button' : 'card')}>
        Toggle Variant
      </button>
      <SquaresEmbedReact variant={variant} />
    </div>
  );
}

License

MIT

Links