Fonts & Assets
Docsta gives you full control over your visual identity. From adding custom fonts to managing static images and icons, you can tailor the look and feel of your documentation site with ease.
1. Adding Custom Fonts
To add custom fonts (like Google Fonts), simply import them in your global CSS or directly in your layout file.
Option 1: Import via CSS
/* styles/globals.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');Option 2: Import using Next.js Font Optimization
For better performance and layout shift prevention:
// app/layout.tsx or pages/_app.tsx
import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'] })
export default function RootLayout({ children }) {
return (
<html lang="en" className={inter.className}>
<body>{children}</body>
</html>
)
}2. Tailwind Configuration
Extend your Tailwind config to use your custom font globally:
// tailwind.config.js
module.exports = {
theme: {
extend: {
fontFamily: {
sans: ['Inter', 'sans-serif'], // or your custom font
heading: ['"DM Sans"', 'sans-serif'],
},
},
},
}Use it in components like:
<h1 className="font-heading text-3xl">Welcome to Docsta</h1>3. Managing Assets
Store all static files—like logos, icons, images, or downloads—in the public/ directory.
public/
├── logo.svg
├── og-image.png
└── downloads/
└── whitepaper.pdfAccess them with relative URLs:
<img src="/logo.svg" alt="Site Logo" />
<a href="/downloads/whitepaper.pdf" download>
Download Whitepaper
</a>4. Favicons & Open Graph Images
Add your favicons and social sharing images in the public/ folder, and reference them in your layout or metadata:
// app/layout.tsx or pages/_document.tsx
<link rel="icon" href="/favicon.ico" />
<meta property="og:image" content="/og-image.png" />5. Optimizing Images
Use Next.js <Image /> component for optimized loading and responsiveness:
import Image from 'next/image'
<Image
src="/logo.svg"
alt="Docsta Logo"
width={120}
height={40}
priority
/>6. SVG Icons
You can import SVGs as React components with:
npm install @svgr/webpackAnd configure it in next.config.js, or use icon libraries like Lucide, Heroicons, or Phosphor for scalable and theme-aware icons.
With Docsta, managing fonts and assets is simple, scalable, and fully customizable—helping you build a fast, consistent, and branded documentation site.
👉 Next Up: Learn how to customize layout components and build dynamic navigation with your fetched content.
What did you think of this content?
It was helpful
It was not helpful
I have a feedback