@hanzo/ui

Truncated Text

import { TruncatedText, TruncatedTextProvider } from '@hanzo/ui'

No examples yet.

Types

export type TruncateMode = 'measure-on-hover' | 'measure-on-open' | 'disabled'
export type TruncatedTextProps = Omit<ComponentProps<typeof SizableText>, 'children' | 'text'> & {
  /** What is shown. A node needs `tooltipContent`, since the hint cannot be read off it. */
  text: ReactNode
  /** Clamp to N lines (wrapping, breaking long words) instead of one line with an ellipsis. */
  lineClamp?: number
  /** The hint, when it should say more or other than `text`. */
  tooltipContent?: ReactNode
  /** Milliseconds before the hint opens. */
  tooltipDelay?: number
  tooltipPlace?: 'top' | 'right' | 'bottom' | 'left'
  /** Keep the hint's line breaks. */
  isTooltipMultiline?: boolean
  /** Show the hint whether or not the text was cut. */
  alwaysShowTooltip?: boolean
  /** A tab stop: focus measures and opens the hint, as a hover does. */
  isFocusable?: boolean
}

Exports

TruncatedTextTruncatedTextProvidertype TruncatedTextPropstype TruncateMode