Skip to content

Commit

Permalink
docs(prefix): cross link usePrefix and ClassPrefix (#12090)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
tay1orjones and kodiakhq[bot] authored Sep 13, 2022
1 parent e2ec828 commit 3719443
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/react/src/components/ClassPrefix/ClassPrefix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ClassPrefix } from '../ClassPrefix';

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

## Table of Contents

- [Overview](#overview)
Expand Down Expand Up @@ -44,8 +45,8 @@ Similarly, you can configure `scss/config` directly:
);
```

In React, you use `ClassPrefix` at the top-level of your project and
specify the prefix with the `prefix` prop:
In React, you use `ClassPrefix` at the top-level of your project and specify the
prefix with the `prefix` prop:

```jsx
import { ClassPrefix } from '@carbon/react';
Expand All @@ -59,6 +60,9 @@ export default function MyApp() {
}
```

To _get_ the prefix, use
[usePrefix](https://react.carbondesignsystem.com/?path=/docs/hooks-useprefix--page)

## Component API

<Props />
Expand All @@ -68,4 +72,3 @@ export default function MyApp() {
Help us improve this component by providing feedback, asking questions on Slack,
or updating this file on
[GitHub](https://github.com/carbon-design-system/carbon/edit/main/packages/react/src/components/ClassPrefix/ClassPrefix.mdx).

3 changes: 3 additions & 0 deletions packages/react/src/internal/usePrefix.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ function ExampleComponent() {
const className = cx(`${prefix}--custom-component`);
}
```

To _set_ the prefix, use
[ClassPrefix](https://react.carbondesignsystem.com/?path=/docs/components-classprefix--default)

0 comments on commit 3719443

Please sign in to comment.