Overriding Components
TutorialKit’s default components are customizable with theming options. In cases where theming is not enough you can override some built-in components with your own ones.
Configuration
Define components
option in your astro.config.ts
:
For example to override TopBar
, provide a path to the new Astro component:
Top Bar
When overriding TopBar
you can place TutorialKit’s default components using following Astro slots:
logo
: Logo of the applicationopen-in-stackblitz-link
: Link for opening current lesson in StackBlitzdownload-button
: Button for downloading current lesson as.zip
filetheme-switch
: Switch for changing the themelogin-button
: For StackBlitz Enterprise user, the login button
Dialog
Component for overriding confirmation dialogs. This component has to be a React component and be the default export of that module.
It will receive same props that @tutorialkit/react/dialog
supports:
HeadTags
Component for overriding title, links and metadata in the <head>
tag.
When overriding HeadTags
you can place TutorialKit’s default components using following Astro slots:
title
: The page titlelinks
: Links for the favicon, fonts and other assetsmeta
: Metadata and Open Graph tags