squircler
Version:
� The MOST PERFECT React squircle component ever created. Zero ovals, infinite possibilities.
19 lines (18 loc) • 870 B
TypeScript
/**
* Generates a squircle path using the superellipse formula
* @param width - Width of the squircle
* @param height - Height of the squircle
* @param n - Squircle-ness factor (2=circle, 4=classic squircle, 10=square-ish)
* @param precision - Number of points to calculate (higher = smoother curve)
* @returns SVG path string
*/
export declare function squirclePath(width: number, height: number, n?: number, precision?: number): string;
/**
* Alternative approach using cubic bezier curves for smoother rendering
* This creates a more optimized path with fewer control points
*/
export declare function squirclePathSmooth(width: number, height: number, n?: number): string;
/**
* Generate CSS clip-path polygon for browsers that support it
*/
export declare function squircleClipPath(width: number, height: number, n?: number, precision?: number): string;