InlineTextFunction

Renders a text-function micronode such as !format:comma{…}, !truncate:8{…} or !pad:6{…}, applied to its body's current text.

@internote/canvas-sdk/reactComponent
On this page
import { InlineTextFunction } from '@internote/canvas-sdk/react';

A bound expression in the body is evaluated against the live-value store first, and the component re-renders when it moves, so a label and the sentence beside it format the same number the same way.

#Props

Takes no className, style or id.

attributes
The micronode's attributes, such as as: and places: for format, by name.
Record<string, unknown>
itemsRequired
The micronode's body, a string or inline content; live values in it are read from the store.
unknown
nameRequired
The text function to apply.
formatupperlowertitletruncatepad

#Example

<InlineTextFunction name="format" items={item.body} attributes={{ as: 'percent', places: 1 }} />

Declared in packages/canvas-sdk/src/content/text-function-values.tsx:137.

Last updated