À propos
Smooth-corner SVG primitives for React, Vue, Svelte, and Octane. Pixel-perfect Figma squircles + three other corner curves.
Développement web et applicatifWhat you can do
- Four corner curves (arc, squircle, superellipse, clothoid) with per-corner mixing
- Inner / outer / middle borders with style variants (solid, dashed, dotted, double, groove, ridge)
- Drop shadows and inner shadows, with gradient borders via the API
- Auto-effects: CSS border and box-shadow are converted to SVG equivalents on mount
Progression mesurée des étoiles
- in 24h
- 0
- in 7 days
- +3
- in 15 days
- +4
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
Original
Lisse
Smooth-corner SVG primitives for React, Vue, Svelte, and Octane. Pixel-perfect Figma squircles + three other corner curves.
English · 日本語 · 한국어 · Deutsch · 简体中文 · Português (BR) · Русский
What is this?
Standard CSS border-radius produces circular arcs at the corners. Designers (and Apple, and Figma) prefer squircles — corners where curvature transitions smoothly into the straight edges, creating a more organic shape.
Lisse implements Figma's corner smoothing algorithm and three other corner curves in JavaScript. It generates SVG paths and CSS clip-path values, with first-class bindings for React, Vue, Svelte, and Octane.
Quick start
npm install @lisse/react
import { SmoothCorners } from "@lisse/react";
function Card() {
return (
<SmoothCorners corners={{ radius: 20, smoothing: 0.6 }} style={{ background: "#fff", padding: 24 }}>
<h2>Hello, squircle</h2>
</SmoothCorners>
);
}
For Vue, Svelte, Octane, or framework-agnostic core, see the packages below.
Curve types
| Curve | Description |
|---|---|
arc |
Quarter circle. Identical to CSS border-radius. |
squircle (default) |
Figma's cubic shoulders + central arc. |
superellipse |
|x/R|^n + |y/R|^n = 1. G2 with edges for n > 2. |
clothoid |
Euler-spiral blend from straight edge to central arc. G2 everywhere. |
Math reference: docs/curves.md.
Packages
Features
- Four corner curves (
arc,squircle,superellipse,clothoid) with per-corner mixing - Inner / outer / middle borders with style variants (solid, dashed, dotted, double, groove, ridge)
- Drop shadows and inner shadows, with gradient borders via the API
- Auto-effects: CSS
borderandbox-shadoware converted to SVG equivalents on mount - ~0.7 µs per cached
generatePath()call (~2.5 µs cold); 500 corners re-compute in under 1 ms (details) - Zero runtime dependencies; ESM + CJS dual export; SSR-safe
/pathsubpath
Documentation
- API reference: full export table
- Migration: upgrading between versions
- SSR: server-side rendering and edge runtimes
- Curves: math reference for each curve type
- Browser support: compatibility matrix
- Styling hooks:
data-slot/data-stateattributes - Effects: borders, shadows, gradients, auto-effects
- Performance: benchmarks and cache architecture
- Internals: how borders, shadows, and resize handling work
- Gotchas:
clip-pathquirks like focus outlines, overflow, scrollbars - Configuration: per-corner config, which API to use, framework usage
Contributing
Issues and PRs welcome. Contributor docs (release process, testing strategy, benchmarks) live in docs/.
License
Explorer des projets similaires
Chargement…