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 | — | string Code snippet. |
label | — | string Label to show above the code snippet. |
hasCopyButton | true | boolean Whether to show a copy button. |