Hex Core JS
    Preparing search index...

    Function TruncatedText

    • Truncates text to a specific number of lines. For toggling functionality, se TruncatedText.useTruncatedText.

      Parameters

      Returns Element

      Children must have inline display to work properly with a single line. For example, FormattedText is not compatible with a single line (but is with multiple lines).

      Setting the overflows value does not work if the value of isExpanded is true initially (but it will update) if the value of isExpanded changes.

    Index

    Methods

    • Wraps useToggle and renames return values for convenience.

      Parameters

      Returns {
          collapse: () => void;
          expand: () => void;
          isExpanded: boolean;
          overflows: boolean;
          setIsExpanded: Dispatch<SetStateAction<boolean>>;
          setOverflows: Dispatch<SetStateAction<boolean>>;
          toggleIsExpanded: () => void;
      }