Toolbar
Introduction to Astro Editor
Astro Editor is an interface for the content in your Astro project — the philosophy page explains why that matters. To properly understand this in practice, it helps to look at a quick example.
Imagine we have an Astro site with two content collections: articles and notes, defined in content.config.ts like this:
const articles = defineCollection({ loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: './src/content/articles' }), schema: ({ image }) => z.object({ title: z.string(), slug: z.string().optional(), draft: z.boolean().default(false), description: z.string().optional(), pubDate: z.coerce.date(), cover: image().optional(), }),});
const notes = defineCollection({ loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: './src/content/notes' }), schema: () => z.object({ title: z.string(), sourceURL: z.string().optional(), slug: z.string().optional(), pubDate: z.coerce.date(), draft: z.boolean().default(false), description: z.string().optional(), tags: z.array(z.string()).optional(), }),});We can expect a note to look something like this in VSCode…

This is not a pleasant interface for writing content.
- VSCode isn’t meant for content editing: we have all sorts of distracting UI plus a load of non-content files in the sidebar.
- The frontmatter is a distraction when writing, and we have to remember the name and types of any fields we want to add.
- The first line in the content is an
importfor an Astro component we’re using further down.
This same file is shown like this in Astro Editor…

- The content is centre-stage and we can only see actual items in our content collections.
- The frontmatter and
imports are hidden. - The frontmatter is instead shown in the right sidebar, and even though there’s no
slugordescriptionin the file’s frontmatter there are empty fields for them in the sidebar because Astro Editor has read the schema and knows those fields are available for notes.
Astro Project Structure
Section titled “Astro Project Structure”Given those two content collections, Astro Editor will expect your project to look something like this:
Directorymy-astro-site
Directorysrc
Directoryassets
Directoryarticles Assets for use in articles
- image1.png
Directorynotes Assets for use in notes
- attachment2.pdf
- image2.png
Directorycontent
Directoryarticles Articles content collection
- first-article.md
- second-article.mdx
- third-article.md
Directorynotes Notes content collection
- note-one.mdx
- note-two.md
Directorycomponents
Directorymdx Components intended for use in MDX files
- Callout.astro
- content.config.ts
- The schema in
content.config.tsprovides information on the content collections and their frontmatter fields. - The
content/<collection>/directories are where we look for the actual content files of each collection. - The
assets/<collection>/directories are where we add images and files dragged into the editor, or uploaded to image frontmatter fields. - The
components/mdx/directory contains components likeCallout.astro, which can be easily inserted into content using the MDX component builder.
The Interface
Section titled “The Interface”Astro Editor uses a simple three-panel layout.

With both sidebars hidden and Focus Mode switched on, we get an extremely clean interface for working with our content.

Astro Site Requirements
Section titled “Astro Site Requirements”Astro Editor will only work properly with Astro projects which:
- Are using Astro 5+ (it might work with Astro 4+ but you should expect a few bugs)
- Use Astro Content Collections and have a
src/content/config.tsorsrc/content.config.tsfile with at least one collection defined usingdefineCollection. It must use theglobloader and have aschema. - Have all collections within a single directory:
src/content/[collectionname]/