Skip to content
Features

Custom logo

Use an image or your own SVG component for site branding.

Use an image

Place your image in public/, for example public/images/logo.png:

Folder
my-docs/
docs/
public/
images/
logo.png
rdx.config.ts

Set navbar.logo to its site-root URL in rdx.config.ts:

ts
import { defineConfig } from '@lexibase/rdx'

export default defineConfig({
  metadata: {
    applicationName: 'My project',
  },
  navbar: {
    title: '',
    logo: '/images/logo.png',
  },
})

The URL starts with / and omits public. No image import or React component is needed. PNG, SVG, JPEG, WebP, GIF, and AVIF files can be used. For an SVG file, use logo: '/images/logo.svg' in the same configuration.

The image keeps its proportions inside RDX's logo area. Its colors remain the same in light and dark themes. The shared navbar, built-in homepage, and 404 pages use this logo. A custom homepage controls its own body.

Run rdx check to check the image path; production builds also report missing logo files. Use metadata.applicationName for the accessible name of the navbar's home link, and navbar.title for optional visible text beside it.

Create an SVG component

Create a components/ folder at the project root to organize your custom React components. Save your SVG component in components/logo.tsx:

Folder
my-docs/
components/
logo.tsx
docs/
public/
rdx.config.ts
tsconfig.json

Use a React component when you want to control the SVG markup, including colors that follow the interface theme. The default RDX logo uses this format:

tsx
// components/logo.tsx
export function Logo({ className }: { className?: string }) {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth={1.5}
      className={className}
      aria-hidden="true"
    >
      <path d="M3 4h7a2 2 0 0 1 2 2v15a3 3 0 0 0-3-3H3V4Z" />
      <path d="M21 4h-7a2 2 0 0 0-2 2v15a3 3 0 0 1 3-3h6V4Z" />
    </svg>
  )
}

Replace the example SVG with your own artwork. Keep its original viewBox and paths, and pass className to the outer <svg> so RDX can size the logo for each location. Avoid fixed width and height styles that override that sizing.

SVG attributes use React names: class becomes className, stroke-width becomes strokeWidth, and fill-rule becomes fillRule.

For a single-color logo, fill="currentColor" or stroke="currentColor" follows the interface's text color in light and dark mode. Keep your own fill and stroke colors for multicolor artwork.

Configure the SVG component

Import the component in rdx.config.ts and assign it to navbar.logo:

ts
import { defineConfig } from '@lexibase/rdx'
import { Logo } from './components/logo'

export default defineConfig({
  metadata: {
    applicationName: 'My project',
  },
  navbar: {
    title: '',
    logo: Logo,
  },
})

Add the import and logo option to your existing configuration, keeping your other settings. Pass Logo, the component itself; RDX renders it with the appropriate styling. An empty navbar.title displays only the logo. Set a title to show text beside it.

The example uses a named export. If your component uses export default, use import Logo from './components/logo' instead.

The same component appears in the built-in homepage when it is enabled. A custom components/home.tsx controls its own content and can import Logo from ./logo. Restart pnpm dev after changing configuration, or rebuild and redeploy for production.

Configure the browser icon

navbar.logo controls the visible site branding. Configure the browser-tab icon with metadata.icons. For an SVG favicon, place the file at public/favicon.svg and add this field to your existing metadata object:

ts
icons: {
  icon: {
    url: '/favicon.svg',
    type: 'image/svg+xml',
  },
},

See Public files for asset paths and Configuration for other metadata options.

TypeScript setup

Keep tsconfig.json at your documentation project's root, beside rdx.config.ts. Local React components need these settings inside compilerOptions:

json
{
  "jsx": "react-jsx",
  "module": "esnext",
  "moduleResolution": "bundler"
}

Include your components/ files in that configuration. This lets the editor check JSX and resolve imports such as ./components/logo without file extensions, including when the documentation is inside a monorepo.