UNPKG

html-squircle

Version:

Utilities for generating superellipse squircles in the form of SVG strings, to be used in clip-path and background inline styles.

21 lines 1.23 kB
import * as React from "react"; import type { SquircleOptionsBackgroundReact, SquircleOptionsClipReact } from "../types.js"; type ElementOf<T extends keyof React.JSX.IntrinsicElements> = React.JSX.IntrinsicElements[T] extends (React.DetailedHTMLProps<infer _, infer A>) ? A : React.JSX.IntrinsicElements[T] extends React.SVGProps<infer A> ? A : never; export declare namespace Squircle { type Props<T extends keyof React.JSX.IntrinsicElements> = React.JSX.IntrinsicElements[T] & { readonly as: T; readonly ref?: React.Ref<ElementOf<T>>; readonly squircle?: SquircleOptionsClipReact | SquircleOptionsBackgroundReact; }; } /** * Polymorphic Squircle component for rendering a squircle where the size is * observed from the DOM element to which it is applied. * * @param as The name of a primitive element. * @param squircle (optional) The options to pass to the squircle computation * function. You can prevent extra re-renders by passing a memoized value. */ export declare const Squircle: <T extends keyof React.JSX.IntrinsicElements>({ as: Element, ref, squircle, style, children, ...restProps }: Squircle.Props<T>) => React.JSX.Element; export {}; //# sourceMappingURL=Squircle.d.ts.map