Skip to main content

Text

Text is used to visually style and provide semantic value for a small piece of text content.


text
import {extend, Text} from '@shopify/post-purchase-ui-extensions';

extend('Checkout::PostPurchase::Render', (root) => {
const text = root.createComponent(Text, undefined, 'Text');

root.appendChild(text);
});
import {render, Text} from '@shopify/post-purchase-ui-extensions-react';

render('Checkout::PostPurchase::Render', () => <App />);

function App() {
return <Text>Text</Text>;
}

optional = ?

NameTypeDescription
size?"auto" | "fill" | numberSize of the text
emphasized?boolean
subdued?boolean
role?"address" | "deletion" | AbbreviationRoleType | DirectionalOverrideRoleType | DatetimeRoleTypeAssign semantic value
id?stringUnique identifier. Typically used as a target for another component's controls to associate an accessible label with an action.
appearance?"critical" | "warning" | "success"Changes the visual appearance

Indicate the text is a date, a time or a duration. Use the "machineReadable" option to help browsers, tools or software understand the human-readable date. Valid format for "machineReadable" can be found here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time#Valid_datetime_Values

NameTypeDescription
type"datetime"
machineReadable?string

Anchor to DirectionalOverrideRoleTypeDirectionalOverrideRoleType

Override the text directionality. Typically used for email and phone numbers.

NameTypeDescription
type"directional-override"
direction"ltr" | "rtl"

Anchor to AbbreviationRoleTypeAbbreviationRoleType

Indicate the text is an abbreviation or acronym. Use the "for" option to provide a description of the abbreviation.

NameTypeDescription
type"abbreviation"
for?string

Was this page helpful?