@workday/canvas-kit-docs
Version:
Documentation components of Canvas Kit components
36 lines (23 loc) • 1.17 kB
text/mdx
import { ExampleCodeBlock, SymbolDoc } from '@workday/canvas-kit-docs';
import Basic from './examples/BodyText/Basic';
# Canvas Kit Body Text
`BodyText` provides a simple way to render body-level text with built-in support for Canvas type
tokens.
## Installation
```sh
yarn add @workday/canvas-kit-react
```
## Usage
### Basic Example
`BodyText` is a Type Level component (along with [`Title`](/components/text/title/),
[`Heading`](/components/text/heading/), and [`Subtext`](/components/text/subtext/)) built on top of
[`Text`](/components/text/text/) which provides a simple way to render body-level text according to
the [Canvas type hierarchy](/tokens/type/#type-styles).
`BodyText` renders a `<p>` element by default with styles equivalent to `type.levels.body[size]`.
You may override the rendered element using the `as` prop.
<ExampleCodeBlock code={Basic} />
### Custom Styles
Body Text supports custom styling via the `cs` prop. For more information, check our
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
## Component API
<SymbolDoc name="BodyText" fileName="/react/" />