Paragraph
A paragraph of body text. The same as `Text` with `as="p"`.
compliant
- Overview
- Props
- Figma
This is strictly equivalent of using the Text component with the as prop set to p.
<Text tag="p">My awesome paragraph content</Text>
Usage​
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Ut porttitor leo a diam sollicitudin. Amet mauris commodo quis imperdiet massa. Eget egestas purus viverra accumsan in nisl. In iaculis nunc sed augue lacus viverra vitae congue eu.
Ut aliquam purus sit amet. Senectus et netus et malesuada fames ac turpis egestas. Arcu dictum varius duis at consectetur lorem donec massa sapien. Urna neque viverra justo nec ultrices dui sapien eget mi.
Styling​
- the component accepts the same properties for styling than Text
- the component does not handle spacing between paragraphs (unlike the legacy
Paragraphcomponent)
Playground​
murray and murray/mobile.Paragraph props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| align | 9 possibilities"unset""left""right""end""start""auto""center""justify"undefined | |||
| aria-disabled | booleanundefined | |||
| aria-label | stringundefined | |||
| aria-level | numberundefined | Heading level when paired with `role="heading"`. | ||
| asChild | 5 possibilitiesboolean"web""except-style""except-style-web"undefined | |||
| className | stringundefined | |||
| color | 4 possibilitiesundefined`$${string}`Variable<any>OpaqueColorValue | Color prop accepts Tamagui color tokens, ColorTokens, or dynamic token strings. Examples: "$grey900", "$indigo500", "$white", or dynamically constructed tokens like `$${name}900` | ||
| dir | "auto"Directionundefined | |||
| ellipsizeMode | "head""middle""tail""clip"undefined | |||
| fontFamily | FontTokensundefined | |||
| htmlFor | stringundefined | |||
| id | stringundefined | |||
| italic | booleanundefined | |||
| lang | LocaleOrLanguageundefined | |||
| maxFontSizeMultiplier | numbernullundefined | |||
| numberOfLines | numberundefined | |||
| onLayout | ((e: LayoutChangeEvent) => void)undefined | |||
| onTextLayout | 2 possibilitiesundefined(e: NativeSyntheticEvent<TextLayoutEventData>) => void | Fires on mobile with the list of rendered lines. Passes through to the underlying RN Text. | ||
| role | Roleundefined | |||
| size | 9 possibilitiesundefinednumberVariable<any>"$text100""$text200""$text300""$text400""$text500"Partial<Record<"$xs" | "$ltVs" | "$vs" | "$ltSm" | "$sm" | "$ltMd" | "$md" | "$ltLg" | "$lg" | "$ltXl" | "$xl" | "$ltXxl" | "$xxl", TextSize>> | Font size and line height token, see `TypographyBaseProps["size"]`. Also accepts one size per breakpoint, e.g. `{ $xs: "$text200", $lg: "$text300" }`: widths that no key matches keep the default or inherited size. | ||
| sx | 2 possibilitiesundefinedOmit<TextProps, "fontStyle" | "fontFamily" | "fontWeight"> | |||
| tabIndex | stringnumberundefined | |||
| tag | "p""span"undefined | |||
| transform | 6 possibilities"none""capitalize""uppercase""lowercase""unset"undefined | |||
| weight | TextWeightundefined |
Undocumented props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| css | any | |||
| dangerouslySetInnerHTML | any |
Style API​
Use sx for one-off adjustments. It accepts these style keys:
Each can be overridden per breakpoint with: