UNPKG

dynascale

Version:

![NPM Version](https://img.shields.io/npm/v/dynascale) ![NPM Last Update](https://img.shields.io/npm/last-update/dynascale) ![NPM Type Definitions](https://img.shields.io/npm/types/dynascale) ![NPM Downloads](https://img.shields.io/npm/dw/dynascale)

38 lines (34 loc) 911 B
import { JSX } from 'react/jsx-runtime'; /** * A component that scales its children to always fit * within its container while maintaining aspect ratio. * @returns */ export declare const Dynascale: ({ defaultScale, minScale, margin, className, debug, children }: ScalingComponentProps) => JSX.Element; declare interface ScalingComponentProps { /** * The default scale */ defaultScale?: number; /** * The minimum scale to apply */ minScale?: number; /** * Margin percentage to leave around the scaled element (0-1) */ margin?: number; /** * Additional class name for the container */ className?: string; /** * Whether to show debug information */ debug?: boolean; /** * Children to render inside the scaling element */ children: React.ReactNode; } export { }