Font Manager
Browse, preview, and add fonts from Fontsource to your Astro project.
Font Manager
The Font Manager lets you browse and install fonts from the Fontsource library. Once installed, select your fonts in Site Style › Typography and click Apply Theme to use them on your site.
Opening the Font Manager
Open Site ▾ › Font Manager (in the Design column), or press ⌘K (Ctrl+K) and type "Font Manager".
You can also add fonts without leaving Site Style: Typography › Browse all opens the same catalog, with Install & use. See Site Style.
Browsing Fonts
The Font Manager provides access to the entire Fontsource library - over 1,500 open-source fonts.
Categories
Filter fonts by category using the sidebar:
| Category | Description |
|---|---|
| All Fonts | Complete font library |
| Sans Serif | Clean, modern fonts without serifs |
| Serif | Traditional fonts with decorative serifs |
| Monospace | Fixed-width fonts for code |
| Display | Decorative fonts for headings |
| Handwriting | Script and handwritten styles |
Search
Use the search bar to find fonts by name. Popular fonts like Inter, Roboto, and Poppins appear first when not searching.
Variable Fonts
Check Variable fonts only to filter for fonts with variable font support. Variable fonts allow smooth weight and style transitions with a single file.
Selecting a Font
Click any font to select it. The right panel shows:
- Font name and category
- Variable font badge (if applicable)
- Version number
- Link to Fontsource for detailed documentation
Previewing Fonts
Preview Text
The preview area shows your selected font with customizable sample text:
- Size options - SM, MD, or LG preview
- Custom text - Type your own preview text
- Full character set - See uppercase, lowercase, and numbers
The preview loads directly from Google Fonts CDN for accurate rendering.
Selecting Weights
Select Weights lists the weights the font comes in:
- 400 (Regular) and 700 (Bold) are selected by default
- Click any weight to toggle selection
The whole @fontsource/{font-id} package is installed, whichever weights you select.
Common weight mappings:
| Weight | Name |
|---|---|
| 100 | Thin |
| 200 | Extra Light |
| 300 | Light |
| 400 | Regular |
| 500 | Medium |
| 600 | Semi Bold |
| 700 | Bold |
| 800 | Extra Bold |
| 900 | Black |
Installing Fonts
When you click Add to Project, the Font Manager installs the @fontsource/{font-id} npm package into your project. This makes the font available, but your site doesn't use it until you pick it in Site Style.
Note: Installing a font triggers an Astro dev server restart (since
package.jsonchanges). The preview may briefly go blank while the server restarts -- this is normal.
Activating a Font
After installing a font, select it in Site Style to use it. Once a font is installed, the Font Manager shows an Open Site Style button.
- Open Site ▾ › Site Style (or click Open Site Style in the Font Manager)
- Go to Typography
- Your installed fonts appear at the top of each font list, under Installed
- Select a font for:
- Body, heading & content font (
--font-sans) -- used for all text - Heading font (
--font-heading) -- turn on Use a different font for headings first - Code font (
--font-mono) -- used for code blocks
- Body, heading & content font (
- Click Apply Theme
When you apply the theme, two things happen automatically:
- Your
theme.cssis updated with the selected font variables - The font import (e.g.
import '@fontsource/inter';) is added inside the frontmatter ofBaseLayout.astro
If you switch fonts later, the old import is removed and replaced with the new one.
Direct Usage in Components
You can reference fonts in your components using the Tailwind classes defined by your theme tokens:
<h1 class="font-heading text-4xl">Welcome</h1>
<p class="font-sans">Body text uses the sans font.</p>Managing Installed Fonts
Viewing Installed Fonts
Fonts you've already installed show a green checkmark in the grid and an Installed badge in the details panel.
Uninstalling Fonts
To remove a font:
- Select the installed font in the Font Manager
- Click the Uninstall button
- The npm package is removed from your project
If the font was active in your theme, open Site Style, select a different font, then click Apply Theme to update the import.
Best Practices
Performance
- Limit font families - Use 1-2 font families maximum
- Limit weights - Only install weights you actually use
- Use variable fonts - One file covers all weights smoothly
Typography Pairing
Common font pairings:
| Use Case | Heading | Body |
|---|---|---|
| Modern | Inter | Inter |
| Classic | Playfair Display | Lora |
| Technical | Space Grotesk | Source Sans 3 |
| Friendly | Poppins | Open Sans |
Variable Font Benefits
Variable fonts offer:
- Smaller file size - One file vs multiple weight files
- Smooth animations - Animate between any weight value
- Flexibility - Use any weight, not just predefined ones
Troubleshooting
Font Not Applying
If an installed font doesn't appear:
- Make sure you selected the font in Site Style and clicked Apply Theme
- Check that the font import exists inside the frontmatter of
BaseLayout.astro - Refresh the preview
- Check browser dev tools for CSS conflicts
Installation Failed
If installation fails:
- Verify your workspace (Codespace or local Docker container) is running
- Check the status dot in the header for a connection problem
- Try refreshing the page
- Check the terminal for npm errors
Next Steps
- Icon Manager - Add icons to your project
- Site Style - Use your fonts across the site
- Design mode - Style elements visually
- Component Library - Pre-built sections