This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
squircle-js is a monorepo that brings iOS-style squircles (smooth corners) to React projects. The main package @squircle-js/react uses figma-squircle to generate SVG clip-paths that create the smooth corner effect impossible with CSS alone.
packages/squircle-element-react/- Main React component library (@squircle-js/react)apps/web/- Next.js documentation/demo sitetooling/- Shared TypeScript config
# Development
pnpm install # Install dependencies (uses pnpm@9.6.0)
pnpm build # Build all packages via Turbo
pnpm dev # Watch mode for development
# Code Quality
pnpm check # Lint and format check via Biome (ultracite)
pnpm fix # Auto-fix linting and formatting issues
pnpm typecheck # Type check all packages
# Releases
pnpm changeset # Create a changeset for versioning
pnpm changeset:version # Bump versions based on changesets
pnpm changeset:release # Build and publish to npmThe main component (packages/squircle-element-react/src/index.tsx) works by:
- Measuring element size via ResizeObserver (custom
useElementSizehook) - Generating an SVG path using
figma-squirclebased on dimensions and corner props - Applying the path as a CSS clip-path
Component Variants:
Squircle- Dynamic component with ResizeObserver for responsive sizingStaticSquircle- For known dimensions (no size observation, better performance)SquircleNoScript- Fallback styles when JavaScript is disabled
Key Props:
cornerRadius- Corner radius in pixelscornerSmoothing- Smoothing intensity (default: 0.6)asChild- Uses Radix UI Slot pattern for composition
- tsup bundles the library (CJS + ESM formats)
- Turbo orchestrates monorepo tasks
- Changesets manages versioning and npm publishing via GitHub Actions
- Does not support
border-width(works with background colors only) - CSS
superellipse()has limited browser support (reason for JS-based approach)
After running any build command (e.g. pnpm build), clean up orphaned Next.js compiler worker processes that may have been left behind if the build was interrupted:
pkill -9 -f "jest-worker/processChild" || trueThis prevents zombie build workers from accumulating and consuming CPU in the background.