{% set code_snippet %}
<h1>Hello world!</h1>
<p>This is a code snippet.</p>
{% endset %}
{% include '@bolt-components-code-snippet/code-snippet.twig' with {
content: code_snippet,
lang: 'html',
} only %}
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
attributes
|
A Drupal-style attributes object with extra attributes to append to this element. |
object
| — |
|
content
|
Content of the code snippet. |
any
| — |
|
lang
|
Code language of the content. Each language comes with its unique syntax highlights. |
string
|
none
|
|
custom_lang_label
|
Custom language label. Only use this if the actual language label is not desired. |
any
| — |
|
mode
|
Toggle between light and dark syntax highlights, or turn it off. This works independently of Bolt color themes. |
string
|
light
|
|
hide_copy
|
Hide copy to clipboard from the code snippet header. |
boolean
| — |
|
hide_lang_label
|
Hide the language label from the code snippet header. |
boolean
| — |
|
npm install @bolt/components-code-snippet