import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
import Basic from './examples/Subtext/Basic';

# Canvas Kit Subtext

`Subtext` provides a simple way to render subtext-level text with built-in support for Canvas type
tokens.

## Installation

```sh
yarn add @workday/canvas-kit-react
```

## Usage

### Basic Example

`Subtext` is a Type Level component (along with [`Title`](/components/text/title/),
[`Heading`](/components/text/heading/), and [`BodyText`](/components/text/body-text/)) built on top
of [`Text`](/components/text/text/) which provides a simple way to render subtext-level text
according to the [Canvas type hierarchy](/tokens/type/#type-styles).

`Subtext` renders a `<p>` element by default with styles equivalent to `type.levels.subtext[size]`.
You may override the rendered element using the `as` prop.

<ExampleCodeBlock code={Basic} />

### Custom Styles

Subtext 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-guides-customizing-styles--docs).

## Component API

<SymbolDoc name="Subtext" fileName="/react/text/" />