File tree
Use the <FileTree>
component to display the structure of a directory with file icons and collapsible sub-directories.
Specify the structure of your files and directories with an unordered Markdown list inside <FileTree>
. Create a sub-directory using a nested list or add a /
to the end of a list item to render it as a directory without specific content.
The following syntax can be used to customize the appearance of the file tree:
- Highlight a file or directory by making its name bold, e.g.
**README.md**
. - Add a comment to a file or directory by adding more text after the name.
- Add placeholder files and directories by using either
...
or…
as the name.
Example
- index.astro
- keystatic.config.tsx
Directorycomponents
- file-tree.astro
- …
Keystatic config
To add this Starlight component as a Keystatic content component, register it as a content component with the following schema: