@eccenca/gui-elements
Version:
GUI elements based on other libraries, usable in React application, written in Typescript.
29 lines (28 loc) • 1.15 kB
TypeScript
import React from "react";
import { OverflowTextProps } from "./../Typography";
export interface TextReducerProps extends Pick<React.HTMLAttributes<HTMLElement>, "children"> {
/**
* Maximum number of nodes that are used from the HTML content.
* An HTML element with multiple sub elements is count as only 1 node.
*/
maxNodes?: number;
/**
* Set maximum string length of returned content.
*/
maxLength?: number;
/**
* Wrap returned content automatically in a `OverflowText` component.
* This way you always will get a element returned that displays only 1 single text line.
*/
useOverflowTextWrapper?: boolean;
/**
* Specify more `OverflowText` properties used when `useOverflowTextWrapper` is set to `true`.
*/
overflowTextProps?: Omit<OverflowTextProps, "passDown">;
}
/**
* Component to reduce HTML markup content to simple text.
* Display can be wrapped easily in `OverflowText`.
*/
export declare const TextReducer: ({ children, maxNodes, maxLength, useOverflowTextWrapper, overflowTextProps, }: TextReducerProps) => React.JSX.Element;
export default TextReducer;