diff --git a/website/docs/components/code-block/partials/code/component-api.md b/website/docs/components/code-block/partials/code/component-api.md index e1ced3a1dbd..add942551a5 100644 --- a/website/docs/components/code-block/partials/code/component-api.md +++ b/website/docs/components/code-block/partials/code/component-api.md @@ -11,6 +11,15 @@ This component uses [prism.js](https://prismjs.com/) under the hood. `ContentBlock::Description` yielded as contextual component (see below). + + Accepts a localized string. The `ariaLabel` value is applied to the code block pre element. + + + Accepts a localized string. The `ariaLabelledBy` value is applied to the code block pre element. + + + Accepts a localized string. The `ariaDescribedBy` value is applied to the code block pre element. + The text/code content for the `CodeBlock`. The component encodes this argument before displaying it. diff --git a/website/docs/components/code-block/partials/code/how-to-use.md b/website/docs/components/code-block/partials/code/how-to-use.md index 28214b85448..a8763b3795c 100644 --- a/website/docs/components/code-block/partials/code/how-to-use.md +++ b/website/docs/components/code-block/partials/code/how-to-use.md @@ -1,5 +1,7 @@ ## How to use this component +To use this component, you must either include the yielded `Title` component, provide an `@ariaLabel`, or specify an `@ariaLabelledBy`. + The basic invocation requires a `@value` argument. The component encodes this argument before displaying it. !!! Info @@ -10,6 +12,7 @@ If the `\n` escape sequence is used in the `@value` string in Handlebars, it wil ```handlebars ``` @@ -70,6 +73,7 @@ The `language` argument sets the syntax highlighting used. We only support the f ```handlebars Accepts a localized string. The `ariaLabelledBy` value is applied to the code editor input element. + + Accepts a localized string. The `ariaDescribedBy` value is applied to the code editor input element. + Used to control whether a copy button for copying the code/text content will be displayed.