G
Tokens
TypographySpacingColorRadiusShadowMotion
Patterns
CardsModals

Text

Size


    <>
      <Text size="s">Size s</Text>
      <Text size="m">Size m</Text>
      <Text size="l">Size l</Text>
      <Text size="xl">Size xl</Text>
      <Text size="xxl">Size xxl</Text>
    </>
  

Weight


    <>
      <Text weight="normal">Weight normal</Text>
      <Text weight="medium">Weight medium</Text>
    </>
  

Display


    <>
      <Text display="block">block</Text>
      <Text display="inline">inline {' '}</Text>
      <Text display="inline-block">inline-block</Text>
    </>
  

Variants


    <Text variant="caps">Caps</Text>
  

Color

See all colors


    <>
      <Text color="content">content</Text>
      <Text color="content2">content2</Text>
      <Text color="content3">content3</Text>
    </>
  

Align


    <Box borderSide="y">
      <Text align="left">Content</Text>
      <Box borderSide="y">
        <Text align="center">Content</Text>
      </Box>
      <Text align="right">Content</Text>
    </Box>
  

Ellipsis


    <Box width="min(50ch, 100%)">
      <Text hasEllipsis>{demoText.l}</Text>
      <br />
      <Text hasEllipsis ellipsisLines={3}>{demoText.l}</Text>
    </Box>
  

Tag


    <>
      <Text tag="p">render p</Text>
      <Text tag="span">render span</Text>
    </>
  

Trim

trimTop and trimBottom remove the extra space added by line-height at the top and bottom, making the text appear evenly padded on all sides.


    <Stack gap="l2">
      <Box borderSide="y" borderColor="red5" borderWidth="2px" width="fit-content" paddingX="s">
        <Text size="xxl" weight="" trimTop>
          Ag
        </Text>
      </Box>
      <Box borderSide="y" borderColor="red5" borderWidth="2px" width="fit-content" paddingX="s">
        <Text size="xxl" weight="" trimTop trimBottom>
          Ag
        </Text>
      </Box>
      <Box borderSide="y" borderColor="red5" borderWidth="2px" width="fit-content" paddingX="s">
        <Text size="xxl" weight="" trimBottom>
          Ag
        </Text>
      </Box>
    </Stack>
  

Trim demo

Props

Name
Type
Default
sizeRESPONSIVE
oneOfType
oneOf
"s" "m" "l" "xl" "xxl"
string
object
'm'
tag
oneOf
'h1' 'h2' 'h3' 'h4' 'h5' 'h6' 'p' 'span' 'label'
'span'
display
oneOf
'block' 'inline-block' 'inline'
'block'
weight
oneOf
"normal" "medium"
color
oneOfType
Object.keys(vars.colors)
string
alignRESPONSIVE
oneOfType
oneOf
'left' 'center' 'right'
string
object
hasEllipsis
bool
ellipsisLines
number
letterSpacing
string
textTransform
oneOf
'capitalize' 'uppercase' 'lowercase'
variant
oneOf
'caps'
trimTop
bool
trimBottom
bool