@workday/canvas-kit-docs
Version:
Documentation components of Canvas Kit components
50 lines (32 loc) • 1.42 kB
text/mdx
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
import {StatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator';
import Basic from './examples/LabelText/Basic';
import Cursor from './examples/LabelText/Cursor';
import Disabled from './examples/LabelText/Disabled';
# Canvas Kit Label Text
<StatusIndicator variant="red">
<StatusIndicator.Label>Deprecated</StatusIndicator.Label>
</StatusIndicator>
`LabelText` has been deprecated and will be removed in a future major version. Please use
[FormField.Label](https://workday.github.io/canvas-kit/?path=/docs/preview-inputs-form-field--basic)
from Preview instead.
`LabelText` provides a simple way to render a label with built-in support for Canvas type tokens.
## Installation
```sh
yarn add @workday/canvas-kit-react
```
## Usage
### Basic Example
`LabelText` renders a `<label>` element. This component is deprecated in favor of `FormField.Label`
since it should be used in tandem with form elements.
<ExampleCodeBlock code={Basic} />
### Cursor
Set the `cursor` prop to render a particular cursor when the mouse pointer is hovering over the
label.
<ExampleCodeBlock code={Cursor} />
### Disabled
Set the `disabled` prop to provide a visual cue that the label and its associated element are
disabled.
<ExampleCodeBlock code={Disabled} />
## Component API
<SymbolDoc name="LabelText" fileName="/react/text/" />