Getting Started
Add fullscreen functionality to code blocks in your Starlight documentation website. This plugin enhances Expressive Code blocks by adding a fullscreen toggle button that allows users to view code in an immersive fullscreen mode.
Prerequisites
Section titled “Prerequisites”You will need to have a Starlight website set up. If you don’t have one yet, you can follow the “Getting Started” guide in the Starlight docs to create one.
Installation
Section titled “Installation”-
starlight-codeblock-fullscreen
is a Starlight plugin. Install it by running the following command in your terminal:Terminal window npm install starlight-codeblock-fullscreenTerminal window pnpm add starlight-codeblock-fullscreenTerminal window yarn add starlight-codeblock-fullscreen -
Configure the plugin in your Starlight configuration in the
astro.config.mjs
file.astro.config.mjs import starlight from '@astrojs/starlight'import { defineConfig } from 'astro/config'import starlightCodeblockFullscreen from 'starlight-codeblock-fullscreen'export default defineConfig({integrations: [starlight({plugins: [starlightCodeblockFullscreen()],title: 'My Docs',}),],}) -
Start the development server to see the fullscreen toggle buttons added to your code blocks.