--- title: "Code" slug: code category: component type: technical-information version: 20.0.0 tokens: 433 source: https://ovh.github.io/design-system/v20.0.0/llms/react-components-code--technical-information.txt --- # Code ## Code This component extends all the native `
` attributes. | Property | Type | Required | Default | Description | |---|---|---|---|---| | `canCopy` | `boolean` | No | undefined | Whether the copy button is displayed. | | `children` | `string` | Yes | undefined | The code to display. | | `highlighter` | `object` | No | undefined | Configuration of a specific code highlighter (see beneath for more details). | | `labelCopy` | `string` | No | undefined | The initial tooltip label on copy button. | | `labelCopySuccess` | `string` | No | undefined | The tooltip label on copy button after a successful copy. | | `onCopy` | `() => void` | No | undefined | Callback fired when the text is copied. | | `positionerStyle` | `CSSProperties` | No | undefined | Custom style applied to the overlay positioner. Useful if you want to override the overlay z-index. | ## CSS Variables | Variable | Default value | |---|---| | `--ods-code-border-radius` | `calc(var(--ods-semantic-size-radius-container) / 2)` | | `--ods-code-padding-horizontal` | `calc(var(--ods-semantic-size-space-inset-inline) * 1.5)` | | `--ods-code-padding-vertical` | `calc(var(--ods-semantic-size-space-inset-block) * 1.5)` | | `--ods-code-background-color` | `var(--ods-semantic-color-surface-code)` | | `--ods-code-text-color` | `var(--ods-semantic-color-content-on-code)` | | `--ods-code-trigger-background-color-active` | `var(--ods-semantic-color-interaction-neutral-active)` | | `--ods-code-trigger-background-color-hover` | `var(--ods-semantic-color-interaction-neutral-hover)` | | `--ods-code-trigger-color` | `var(--ods-semantic-color-content-on-code)` | | `--ods-code-trigger-outline-color` | `var(--ods-semantic-color-content-on-code)` |