UNPKG

react-text-ellipsis-clamp

Version:

Ultra-lightweight React component (165 bytes gzipped) to clamp multiline text with CSS-only ellipsis. Zero dependencies, TypeScript support, and production-ready performance.

17 lines (16 loc) 640 B
type IntrinsicEl = keyof JSX.IntrinsicElements; export type EllipsisProps<T extends IntrinsicEl = "div"> = { maxLines?: number; expandable?: boolean; as?: T; } & Omit<JSX.IntrinsicElements[T], "ref" | "children"> & { children?: React.ReactNode; }; export declare const Ellipsis: import("react").ForwardRefExoticComponent<{ maxLines?: number; expandable?: boolean; as?: "div" | undefined; } & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | "children"> & { children?: React.ReactNode; } & import("react").RefAttributes<HTMLElement>>; export {};