Getting Started
A Starlight component to explore and document files and folders in your project with an interactive file explorer:
- Markdown and MDX content for each file and folder, including Starlight components
- Files and folders linkable from anywhere
- Automatic file icons picked from file names with optional custom icons
- Badges to highlight important files and folders
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”-
Install the Starlight File Explorer component using your favorite package manager:
-
Use the component in any MDX files of your Starlight documentation site.
src/content/docs/example.mdx import { FileExplorer, File, Folder } from 'starlight-file-explorer'<FileExplorer label="Project structure"><Folder name="src">The source code of your project.<File name="content.config.ts">The content collections configuration file.</File></Folder><File name="astro.config.mjs">The Astro configuration file.</File></FileExplorer> -
Start the development server to preview the component.
Using the previous example, the result should look like this:
Preview - Directorysrc
- content.config.ts
- astro.config.mjs
src/src/The source code of your project.
src/content.config.ts content.config.tsThe content collections configuration file.
astro.config.mjsastro.config.mjsThe Astro configuration file.
For more details and examples, please refer to the usage guide.