Text
Renders a text node.
Usage
Code
import { createSystem } from 'frog/ui'
const { Text } = createSystem()
function Example() {
return <Text>Hello world</Text>
}
Text
Properties
align
Sets the horizontal alignment of the text.
Code
function Example() {
return <Text align="leftrightcenterendstartjustifyright">Hello world</Text>
}
color
Sets the color of the text.
Values are mapped to the colors
property on the UI System Variables.
Code
function Example() {
return <Text color="rred100red200red300red400red500red600redred700red800red900red1000ed">Hello world</Text>
}
decoration
Sets the text decoration.
Code
function Example() {
return <Text decoration="dasheddottedsolidline-throughunderlineunderline">Hello world</Text>
}
font
Sets the font family of the text.
Values are mapped to the fonts
property on the UI System Variables.
Code
function Example() {
return <Text font="merriweather">Hello world</Text>
}
size
Sets the size of the font.
Values are mapped to the fontSizes
property on the UI System Variables.
Code
function Example() {
return <Text size="12141618202432486432">Hello world</Text>
}
tracking
Sets the horizontal spacing behavior between text characters.
Values are mapped to the units
property on the UI System Variables.
Code
function Example() {
return <Text tracking="0123468101214161820222426283032343638404244464852566064728096128160192224256-2-0-1-3-4-6-8-10-12-14-16-18-20-22-24-26-28-30-32-34-36-38-40-42-44-46-48-52-56-60-64-72-80-96-128-160-192-224-256-2">Hello world</Text>
}
weight
Sets the weight (or boldness) of the font.
Code
function Example() {
return <Text weight="100200300400500600700800900600">Hello world</Text>
}
wrap
Defines how the text should be wrapped.
Code
function Example() {
return <Text wrap="balancebalance">Hello world, this is me.</Text>
}