Code snippet is used to display code or commands for user to copy and paste.
The default variant, base, renders on a light gray background.
Use the white variant to add contrast against a gray background. Typically used with forms.
| Name | Default | Description |
|---|---|---|
variant | "base" | "base" | "white"The variant determines the background color of the code snippet. |
code | — | stringCode snippet. |
label | — | stringLabel to show above the code snippet. |
hasCopyButton | true | booleanWhether to show a copy button. |