or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

blog-components.mdcontent-components.mdcore-plugin.mddocumentation-components.mdicon-components.mdindex.mdlayout-components.mdnavigation-components.mdtheme-configuration.mdutility-components.md
tile.json

navigation-components.mddocs/

Navigation Components

Comprehensive navigation system including navbar, mobile navigation, navigation items, and breadcrumb components for site navigation and user experience.

Capabilities

Main Navbar

The primary navigation bar component that appears at the top of all pages.

/**
 * Main navigation bar component
 * @returns Navbar with logo, navigation items, and mobile toggle
 */
function Navbar(): ReactNode;

Navbar Layout

Layout wrapper for navbar content with responsive behavior.

/**
 * Navbar layout wrapper
 * @param props - Layout props containing navbar children
 * @returns Navbar layout structure
 */
function NavbarLayout(props: NavbarLayoutProps): ReactNode;

interface NavbarLayoutProps {
  readonly children: React.ReactNode;
}

Navbar Content

Container for navbar content including navigation items.

/**
 * Navbar content container
 * @returns Navbar content with navigation items
 */
function NavbarContent(): ReactNode;

Navbar Logo

Logo component within the navbar.

/**
 * Navbar logo component
 * @returns Logo element with site branding
 */
function NavbarLogo(): ReactNode;

Navbar Color Mode Toggle

Color mode toggle button within the navbar.

/**
 * Navbar color mode toggle
 * @param props - Toggle props
 * @returns Color mode toggle button or null
 */
function NavbarColorModeToggle(props: NavbarColorModeToggleProps): ReactNode | null;

interface NavbarColorModeToggleProps {
  readonly className?: string;
}

Navbar Search

Search component within the navbar.

/**
 * Navbar search component
 * @param props - Search container props
 * @returns Search input wrapper
 */
function NavbarSearch(props: NavbarSearchProps): ReactNode;

interface NavbarSearchProps {
  readonly children: ReactNode;
  readonly className?: string;
}

Mobile Sidebar

Mobile navigation sidebar for responsive navigation.

/**
 * Mobile navigation sidebar
 * @returns Mobile sidebar with navigation menu
 */
function NavbarMobileSidebar(): ReactNode;

Mobile Sidebar Layout

Layout structure for mobile sidebar content.

/**
 * Mobile sidebar layout structure
 * @param props - Layout props with header and menu sections
 * @returns Mobile sidebar layout
 */
function NavbarMobileSidebarLayout(props: MobileSidebarLayoutProps): ReactNode;

interface MobileSidebarLayoutProps {
  readonly header: ReactNode;
  readonly primaryMenu: ReactNode;
  readonly secondaryMenu: ReactNode;
}

Mobile Sidebar Toggle

Toggle button to open/close mobile sidebar.

/**
 * Mobile sidebar toggle button
 * @returns Hamburger menu button
 */
function NavbarMobileSidebarToggle(): ReactNode;

Mobile Sidebar Header

Header section of mobile sidebar.

/**
 * Mobile sidebar header
 * @returns Sidebar header with logo and close button
 */
function NavbarMobileSidebarHeader(): ReactNode;

Mobile Sidebar Menus

Primary and secondary menu sections for mobile sidebar.

/**
 * Primary navigation menu for mobile sidebar
 * @returns Primary navigation items
 */
function NavbarMobileSidebarPrimaryMenu(): ReactNode;

/**
 * Secondary navigation menu for mobile sidebar
 * @returns Secondary navigation items
 */
function NavbarMobileSidebarSecondaryMenu(): ReactNode;

Navigation Items

Generic navigation item components supporting multiple item types.

/**
 * Generic navbar item component supporting multiple types
 * @param props - Navigation item props
 * @returns Navigation item element
 */
function NavbarItem(props: NavbarItemProps): ReactNode;

type NavbarItemProps = ComponentProps<'a'> & {
  readonly position?: 'left' | 'right';
} & (
  | LinkLikeNavbarItemProps
  | DropdownNavbarItemProps
  | DocsVersionDropdownNavbarItemProps
  | LocaleDropdownNavbarItemProps
  | SearchNavbarItemProps
);

type NavbarItemType = NavbarItemProps['type'];

Default Navbar Item

Standard navigation link item.

/**
 * Default navigation item (link)
 * @param props - Default item props
 * @returns Navigation link element
 */
function DefaultNavbarItem(props: DefaultNavbarItemProps): ReactNode;

interface DefaultNavbarItemProps {
  readonly isDropdownItem?: boolean;
  readonly className?: string;
  readonly position?: 'left' | 'right';
  readonly mobile?: boolean;
  // Link properties
  readonly label?: ReactNode;
  readonly html?: string;
  readonly to?: string;
  readonly href?: string;
  readonly activeBasePath?: string;
  readonly activeBaseRegex?: string;
  readonly exact?: boolean;
  readonly prependBaseUrlToHref?: boolean;
}

Desktop and Mobile Variants

Responsive variants for default navbar items.

/**
 * Desktop-specific navbar item
 * @param props - Desktop item props
 * @returns Desktop navigation item
 */
function DefaultNavbarItemDesktop(props: DefaultNavbarItemProps): ReactNode;

/**
 * Mobile-specific navbar item
 * @param props - Mobile item props
 * @returns Mobile navigation item
 */
function DefaultNavbarItemMobile(props: DefaultNavbarItemProps): ReactNode;

Dropdown Navigation Items

Dropdown menu navigation items with submenu support.

/**
 * Dropdown navigation item with submenu
 * @param props - Dropdown item props
 * @returns Dropdown menu component
 */
function DropdownNavbarItem(props: DropdownNavbarItemProps): ReactNode;

interface DropdownNavbarItemProps {
  readonly position?: 'left' | 'right';
  readonly items: readonly LinkLikeNavbarItemProps[];
  readonly className?: string;
  readonly mobile?: boolean;
  // Base link properties
  readonly label?: ReactNode;
  readonly html?: string;
  readonly to?: string;
  readonly href?: string;
  readonly activeBasePath?: string;
  readonly activeBaseRegex?: string;
  readonly exact?: boolean;
  readonly prependBaseUrlToHref?: boolean;
  readonly isDropdownLink?: boolean;
}

Dropdown Desktop and Mobile

Platform-specific dropdown implementations.

/**
 * Desktop dropdown navbar item
 * @param props - Desktop dropdown props
 * @returns Desktop dropdown menu
 */
function DropdownNavbarItemDesktop(props: DropdownNavbarItemProps): ReactNode;

/**
 * Mobile dropdown navbar item
 * @param props - Mobile dropdown props
 * @returns Mobile dropdown menu
 */
function DropdownNavbarItemMobile(props: DropdownNavbarItemProps): ReactNode;

Specialized Navigation Items

Specialized navigation items for specific functionality.

Locale Dropdown

Language/locale selection dropdown.

/**
 * Locale dropdown for language selection
 * @param props - Locale dropdown props
 * @returns Language selection dropdown
 */
function LocaleDropdownNavbarItem(props: LocaleDropdownNavbarItemProps): ReactNode;

interface LocaleDropdownNavbarItemProps extends DropdownNavbarItemProps {
  readonly dropdownItemsBefore: LinkLikeNavbarItemProps[];
  readonly dropdownItemsAfter: LinkLikeNavbarItemProps[];
  readonly queryString?: string;
}

Documentation Version Dropdown

Dropdown for selecting documentation versions.

/**
 * Documentation version selection dropdown
 * @param props - Version dropdown props
 * @returns Documentation version dropdown
 */
function DocsVersionDropdownNavbarItem(props: DocsVersionDropdownNavbarItemProps): ReactNode;

interface DocsVersionDropdownNavbarItemProps extends DropdownNavbarItemProps {
  readonly docsPluginId?: string;
  readonly dropdownActiveClassDisabled?: boolean;
  readonly dropdownItemsBefore: LinkLikeNavbarItemProps[];
  readonly dropdownItemsAfter: LinkLikeNavbarItemProps[];
  readonly versions?: string[] | {[version: string]: {label?: string}};
}

Documentation Version Item

Link to specific documentation version.

/**
 * Documentation version link item
 * @param props - Version link props
 * @returns Documentation version link
 */
function DocsVersionNavbarItem(props: DocsVersionNavbarItemProps): ReactNode;

interface DocsVersionNavbarItemProps extends DefaultNavbarItemProps {
  readonly docsPluginId?: string;
}

Document Navigation Items

Navigation items for specific documentation pages and sidebars.

/**
 * Link to specific documentation page
 * @param props - Doc link props
 * @returns Documentation page link or null
 */
function DocNavbarItem(props: DocNavbarItemProps): ReactNode | null;

interface DocNavbarItemProps extends DefaultNavbarItemProps {
  readonly docId: string;
  readonly docsPluginId?: string;
}

/**
 * Link to documentation sidebar
 * @param props - Sidebar link props
 * @returns Documentation sidebar link
 */
function DocSidebarNavbarItem(props: DocSidebarNavbarItemProps): ReactNode;

interface DocSidebarNavbarItemProps extends DefaultNavbarItemProps {
  readonly sidebarId: string;
  readonly docsPluginId?: string;
}

Search Navbar Item

Search functionality integration in navbar.

/**
 * Search navbar item
 * @param props - Search item props
 * @returns Search component
 */
function SearchNavbarItem(props: SearchNavbarItemProps): ReactNode;

interface SearchNavbarItemProps {
  readonly mobile?: boolean;
  readonly className?: string;
}

HTML Navbar Item

Custom HTML content in navbar.

/**
 * Custom HTML navbar item
 * @param props - HTML item props
 * @returns Custom HTML element
 */
function HtmlNavbarItem(props: HtmlNavbarItemProps): ReactNode;

interface HtmlNavbarItemProps extends DefaultNavbarItemProps {
  readonly value: string;
}

Navigation Link Component

Base navigation link component used by navbar items.

/**
 * Base navigation link component
 * @param props - Navigation link props
 * @returns Navigation link element
 */
function NavbarNavLink(props: NavbarNavLinkProps): ReactNode;

interface NavbarNavLinkProps {
  readonly activeBasePath?: string;
  readonly activeBaseRegex?: string;
  readonly exact?: boolean;
  readonly label?: ReactNode;
  readonly html?: string;
  readonly prependBaseUrlToHref?: boolean;
  readonly isDropdownLink?: boolean;
  // Standard link props
  readonly to?: string;
  readonly href?: string;
  readonly className?: string;
  readonly target?: string;
}

Usage Examples

Basic Navbar Configuration

// docusaurus.config.js
export default {
  themeConfig: {
    navbar: {
      title: 'My Site',
      logo: {
        alt: 'My Site Logo',
        src: 'img/logo.svg',
      },
      items: [
        {
          type: 'doc',
          docId: 'intro',
          position: 'left',
          label: 'Tutorial',
        },
        {
          type: 'dropdown',
          label: 'Community',
          position: 'left',
          items: [
            {
              label: 'Discord',
              href: 'https://discord.gg/docusaurus',
            },
            {
              label: 'Twitter',
              href: 'https://twitter.com/docusaurus',
            },
          ],
        },
        {
          type: 'localeDropdown',
          position: 'right',
        },
        {
          href: 'https://github.com/facebook/docusaurus',
          label: 'GitHub',
          position: 'right',
        },
      ],
    },
  },
};

Custom Swizzled Navbar Item

import React from 'react';
import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem';

export default function CustomNavbarItem(props) {
  return (
    <DefaultNavbarItem
      {...props}
      className={`${props.className || ''} custom-navbar-item`}
    />
  );
}