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>

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:150

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 380919b. ALPHA — NOT FOR PRODUCTION USE.