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>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:150
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 2dccb19. ALPHA — NOT FOR PRODUCTION USE.