@workday/canvas-kit-docs
Version:
Documentation components of Canvas Kit components
53 lines (36 loc) • 1.69 kB
text/mdx
import {ExampleCodeBlock, StorybookStatusIndicator, SymbolDoc} from '@workday/canvas-kit-docs';
import {InformationHighlight} from '@workday/canvas-kit-preview-react/information-highlight';
import Basic from './examples/LabelText/Basic';
import Cursor from './examples/LabelText/Cursor';
import Disabled from './examples/LabelText/Disabled';
<InformationHighlight className="sb-unstyled" variant="caution" cs={{p: {marginBlock: 0}}}>
<InformationHighlight.Icon />
<InformationHighlight.Body>
`LabelText` has been deprecated and will be removed in a future major version. Please use
`FormField.Label` instead.
</InformationHighlight.Body>
<InformationHighlight.Link href="https://workday.github.io/canvas-kit/?path=/story/components-inputs-form-field--docs">
Form Field Docs
</InformationHighlight.Link>
</InformationHighlight>
`LabelText` provides a simple way to render a label with built-in support for Canvas type tokens.
```sh
yarn add @workday/canvas-kit-react
```
`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} />
Set the `cursor` prop to render a particular cursor when the mouse pointer is hovering over the
label.
<ExampleCodeBlock code={Cursor} />
Set the `disabled` prop to provide a visual cue that the label and its associated element are
disabled.
<ExampleCodeBlock code={Disabled} />
<SymbolDoc name="LabelText" fileName="/react/text/" />