Body
A typography primitiving for displaying text and paragraphs in an interface.
This component provides all relevant typographic styles such as font-family,
line-height and font-size.
Body
React
Body composes Box so you can use all the style props and add responsive
styles as well.
import { Body } from '@hoverinc/design-system-react-web';
Size
Body defaults to size 500, pass the size prop to set a custom a size.
Size Aliases
The Body component now supports size aliases that match the text styles that design uses.
Text Styles
Body typographic styles can also be applied via textStyles to other elements
and in component theming.
Truncation
If you'd like to truncate the text after a specific number of lines, pass the
noOfLines prop. This will render an ellipsis when the text exceeds the width
of the viewport or maxWidth prop.
Balanced Wrapping
If text is wrapped into multiple lines, the prop balancedText can be used to
ensure the lines have approximately the same width.
Semantic Element
The Body component renders a p tag by default. To override the element
that gets rendered, pass the as prop.
Capsize
Sometimes, in order to align text properly, it's necessary to do so based on the
height of the capital letters instead of the raw line-height value. For these
cases, Body presets are available with a
Capsize adjustment so that the vertical
size of the text is aligned with its
cap height.
Pass withCapsize to enable Capsize dimensions for Heading. Toggle the
checkboxes below to see the difference in layout.
Body Copy
Text Style
Capsize can also be applied via textStyle:
React Native
import { Body } from '@hoverinc/design-system-react-native';
Body on React Native supports the same size variants: medium (default),
small, footnote, and label.
Font Scaling
This component supports dynamic font scaling for accessibility, capped at 1.35x. See Typography — Font Scaling for full details on how scaling works and how to extend text components.