Skip to Content
Nextra 4.0 is released. Read more
DocumentationGuideSearch Engine

Search Engine

Nextra features full-page search, that includes list items, code blocks, headings and table cells.

Nextra indexes your content automatically at build-time and performs incredibly fast full-text search via FlexSearch .

Configuration

nextraConfig.search

  • Type: boolean | { codeblocks: boolean }
  • Default: true

Example

next.config.mjs
import nextra from 'nextra'
 
const withNextra = nextra({
  theme: 'nextra-theme-blog',
  themeConfig: './theme.config.js',
  search: {
    codeblocks: false
  }
})

Search in Code Blocks

Inline <code attr="foo" /> can be searched as well as code blocks.

<code>I'm Searchable!</code>
💡
Tip

To disable search in code blocks set search: { codeblocks: false }

Last updated on