Home
CH.Slideshow
Learn how to use the experimental CH.Slideshow component from Code Hike in your documentation to create interactive code blocks that are displayed as a slideshow.
Note
This component is best viewed on larger screens, such as a desktop.
Overview
<CH.Slideshow>
is used to wrap text and code into separate slides with buttons
to navigate between slides. A CodeSandbox can be
linked to the slideshow to add a live preview that updates to match the code in
the current slide.
Caution
CH.Slideshow
is currently still an experimental feature in Code Hike. Refer to
Code Hike's website for more
information.
Properties
Name | Type | Description |
---|---|---|
lineNumbers (optional) | boolean | Option to show line numbers for each row of code. The default is false . |
preset (optional) | url | Option to link to a Code Sandbox project if you would like to include a preview with the code. |
rows | integer or focus | Option to set a custom height for the code block based on either a specified number of rows or focus annotation. |
showCopyButton (optional) | boolean | Option to show copy button on the code block. The default is true |
Examples
Tip
To display code blocks as tabs or panels within CH.Scrollycoding
, wrap code
blocks in a CH.Code
component. Refer to CH.Code for
detailed instructions and examples.
Simple slideshow
Slideshow with preview
Here is an example of a slideshow that pairs text and a CodeSandbox preview with the code: