Text
The Text is used to create various levels of typographic hierarchies.
Import
Importimport { Text } from '@backyard-ui/core';Usage
UsageSize
SizeUse the size prop to increase the visual size.
Color
ColorUse the color prop to change the visual color.
Decoration
DecorationUse the decoration prop to apply some decoration.
Truncate
TruncateUse the noOfLines prop to truncate the text with a specific number of lines.
Override the element
Override the elementTo override the element that gets rendered, use the asChild.
API Reference
API Reference- colorDescription The CSS `color` propertyType
"inherit" | "black" | "white" | "current" | "transparent" | "product-facebook" | "product-google" | "product-linkedin" | "product-pinterest" | "product-twitter" | "product-youtube" | ... 145 more ...Defaultblack - children requiredDescription The text childrenType
ReactNode - asChildDescription Change the component to the HTML tag or custom component of the only childType
boolean - alignDescription The CSS `text-align` propertyType
"center" | "right" | "left" | "start" | "end" | "justify" - transformDescription The CSS `text-transform` propertyType
"none" | "uppercase" | "lowercase" | "capitalize" - sizeDescription The Text sizeType
"xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl"Defaultlg - decorationDescription The CSS `text-decoration-line` propertyType
"none" | "underline" | "overline" | "line-through" - noOfLinesDescription The CSS `line-clamp` propertyType
number - weightDescription The CSS `font-weight` propertyType
"black" | "thin" | "extralight" | "light" | "normal" | "medium" | "semibold" | "bold" | "extrabold"Defaultnormal - isItalicDescription The CSS `font-style` propertyType
booleanDefaultfalse