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

@usespaceui/squircle

v0.1.2

Published

Flawless math-driven squircle masking and geometry rendering for modern UIs.

Readme


✨ Overview

@usespaceui/squircle brings iOS-style squircles (mathematically perfect superellipses) to your Tailwind CSS projects. It mimics the continuous curvature corners found in Figma and Apple devices. By combining native CSS corner-shape: squircle with progressive CSS Houdini Paint Worklet fallbacks, it provides instantaneous zero-lag rendering and seamlessly integrates with Tailwind CSS.


📦 Installation

pnpm add @usespaceui/squircle
# or
npm install @usespaceui/squircle
# or
yarn add @usespaceui/squircle

Zero dependencies. Add the plugin to your Tailwind configuration (v3) or your CSS entry file (v4).


🚀 Setup

Because the plugin relies on a CSS Houdini worklet to draw the shape, you must initialize the script once in your app.

With React / Next.js

Since the worklet interacts with the browser DOM, initialize it inside a Client Component provider.

// components/SquircleProvider.tsx
'use client'
import * as React from 'react'
import { initSquircle } from '@usespaceui/squircle'

// Initialize immediately as client bundle loads before paint
if (typeof window !== 'undefined') {
  initSquircle()
}

export function SquircleProvider({ children }: { children: React.ReactNode }) {
  return <>{children}</>
}

Wrap your root layout:

import { SquircleProvider } from './SquircleProvider'

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <body>
        <SquircleProvider>{children}</SquircleProvider>
      </body>
    </html>
  )
}

With Vanilla JS

Initialize the worklet directly in your client-side entry file:

import { initSquircle } from '@usespaceui/squircle'

if (typeof window !== 'undefined') {
  initSquircle()
}

Configure Tailwind CSS 4

In Tailwind CSS v4, add the plugin directly to your CSS entry point (e.g. globals.css or styles.css):

@import 'tailwindcss';
@plugin "@usespaceui/squircle";

Configure Tailwind CSS 3

Add the squircle plugin to your tailwind.config.js or tailwind.config.ts:

CommonJS (tailwind.config.js)

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ['./src/**/*.{js,ts,jsx,tsx}'],
  theme: {
    extend: {},
  },
  plugins: [require('@usespaceui/squircle')],
}

ESM / TypeScript (tailwind.config.ts or tailwind.config.mjs)

import type { Config } from 'tailwindcss'
import squircle from '@usespaceui/squircle'

const config: Config = {
  content: ['./src/**/*.{js,ts,jsx,tsx}'],
  theme: {
    extend: {},
  },
  plugins: [squircle],
}

export default config

🎨 Usage

1. Sizing

Apply the squircle utility alongside your Tailwind rounded-* classes:

<!-- Standard Tailwind sizes -->
<button class="squircle rounded-2xl bg-black text-white px-6 py-3">
  Space UI Squircle
</button>

<!-- Smooth hover transitions between radii -->
<button class="squircle rounded-7xl hover:rounded-3xl transition-all duration-300">
  Interactive Squircle
</button>

<!-- Pill / Circle -->
<div class="squircle rounded-full">...</div>

<!-- Arbitrary values -->
<div class="squircle rounded-[40px]">...</div>

2. Smoothing Intensity

By default, squircle applies a 60% smooth transition, perfectly matching Apple (iOS) and Figma's native continuous curvature.

You can adjust this intensity using modifiers (/0, /20, /40, /60, /80, /100):

<!-- Maximum smoothing (pronounced superellipse) -->
<button class="squircle/100 rounded-3xl">...</button>

<!-- Minimal smoothing (closer to a plain rounded rectangle) -->
<button class="squircle/20 rounded-3xl">...</button>

<!-- Default is 60% (matches Apple iOS & Figma perfectly) -->
<button class="squircle rounded-3xl">...</button>

Note on custom smoothing: Custom smoothing modifiers are processed dynamically by the CSS Houdini engine. In browsers with native corner-shape: squircle, the native CSS superellipse curve is used by default.


3. Borders & Outlines

Use standard Tailwind border utilities (border, border-2, border-8, etc.). The squircle contour shapes both the background and the border:

<!-- 8px border following squircle curvature -->
<button class="squircle rounded-7xl border-8 border-red-500 bg-black text-white">
  Bordered Squircle
</button>

<!-- 1px subtle border -->
<div class="squircle rounded-3xl border border-border bg-card">
  Card with Squircle Border
</div>

🧰 Utilities Included

  • initSquircle() Registers the CSS Houdini Paint Worklet and sets up the custom CSS properties (--tw-squircle-w and --tw-squircle-smooth). It is safe to call multiple times and fails gracefully in environments where Houdini is not supported.

  • plugin(tailwindcss) The default export is a Tailwind CSS plugin that provides the squircle utility class. It automatically provides fallback border-radius styles for browsers that don't support the Paint API.


Features

  • 💃 Native Tailwind Integration: Use the squircle utility alongside standard rounded-* classes. No framework-specific wrappers required, and if the browser doesn't support the Paint API, standard rounded fallback values apply automatically.
  • ⚡ Zero-JS Layout Thrashing: Driven by the native CSS Paint API (Houdini). No ResizeObserver, no DOM manipulation, no SVG paths. Repaints happen instantly on the compositor thread.
  • 👌 Framework Agnostic: Works in React, Vue, Svelte, Solid, or plain HTML.

📦 Related Packages

| Package | Description | | -------------------------------------------------------------- | --------------------------------------- | | @usespaceui/avatars | Generative deterministic avatars | | @usespaceui/sounds | UI sound effects and audio interactions |


🪪 License

MIT — Free for commercial and personal use.


📚 Resources


🛠 Maintenance

If you find a bug or have a feature request, please open an issue on GitHub. Engine internals are intentionally not part of the public API.