Text
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.
API details from source
Section titled “API details from source”
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.
Parameters
Section titled “Parameters”props— Authored component inputs, supplied through JSX or createElement. See the linked props and style types.
Throws
Section titled “Throws”When called directly; Pibbl mounts this component through JSX or createElement.
See also
Section titled “See also”View source — packages/core/src/lib/components/text.ts:154
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Drawing composition: Group, cache, and clip a drawing, then add text and an embedded thumbnail. Plain source
Interactive examples
Section titled “Interactive examples”- Text · Full page
- Filters · Full page
- Underwater scene · Full page
- Optional filters · Full page
- Text envelope playground · Full page
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision a1dcf8e. ALPHA — NOT FOR PRODUCTION USE.