Skip to content

Text

Read as Markdown

import { Text } from "@pibbl/core";

Text uses TextProps and TextStyle, and accepts recursive PibblTextChild content rather than visual child elements. It supports paint, wrapping, fitting, and measurement under its local style. Font rasterization and measurement are browser behavior. Ellipsis fitting preserves complete grapheme clusters, including combining marks and joined emoji, using the browser’s Intl.Segmenter. It does not truncate inside a cluster. Font loading and any update needed after a font arrives remain application responsibilities.

<Text
style={{ left: 20, top: 44, fill: "#0f172a", font: "600 24px sans-serif" }}
>
Hello, {42}
</Text>

Experimental finite LTR nowrap Flex can align fixed Text leaves with alignItems: "first-baseline". Nonempty visible content may wrap at its final allocated width; the provider reports its first and last actual visible lines. The bounded font form is a positive pixel size plus sans-serif, serif, or monospace, optionally preceded by bold, italic, or normal. This uses live Canvas metrics through the optional baseline-aware measurement service, without claiming native font parity or font-load invalidation. See the first-baseline example and measurement service.

Try the Text live example.

Draws Canvas text from textual children using the resolved font, wrapping, fitting, and paint style.

Text: PibblPrimitiveComponent<TextProps, PrimitiveInput<TextProps, TextStyle>>

Related API: Text, PibblPrimitiveComponent, TextProps, PrimitiveInput, TextStyle.

  • props — Authored component inputs, supplied through JSX or createElement. See the linked props and style types.

When called directly; Pibbl mounts this component through JSX or createElement.

TextProps

TextStyle

View source — packages/core/src/lib/components/text.ts:154

Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

Documentation built with @pibbl/core 0.0.2, revision a1dcf8e. ALPHA — NOT FOR PRODUCTION USE.