cel-tui
    Preparing search index...

    Interface TextProps

    Props for the Text primitive.

    Text is a styled leaf node with no children and no sizing props — the parent container controls the box. Height is intrinsic, computed from content, newlines, and word-wrapping at the given width.

    interface TextProps {
        bgColor?: Color;
        bold?: boolean;
        fgColor?: Color;
        italic?: boolean;
        repeat?: number | "fill";
        underline?: boolean;
        wrap?: "none" | "word";
    }

    Hierarchy (View Summary)

    Index

    Properties

    bgColor?: Color

    Background color.

    bold?: boolean

    Render text with bold weight.

    fgColor?: Color

    Foreground (text) color.

    italic?: boolean

    Render text in italic style.

    repeat?: number | "fill"

    Repeat the text content a fixed number of times or to fill the available width. When set, wrapping is ignored.

    repeat: "fill"  // fills parent width (e.g., dividers)
    repeat: 20 // repeats exactly 20 times
    underline?: boolean

    Render text with an underline.

    wrap?: "none" | "word"

    Text wrapping mode.

    • "none" (default) — no wrapping, content is hard-clipped at the box edge.
    • "word" — word-wrap to fit available width. Affects computed height.

    Whitespace is always preserved. \n produces explicit line breaks.