Search

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>
đź’ˇ

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