Tailwind CSS Navbar - Theme

Learn how to customize the theme and styles for navbar component, the theme object for navbar component has three main objects:

A. The defaultProps object for setting up the default value for props of navbar component.
B. The valid object for customizing the valid values for navbar component props.
C. The styles object for customizing the theme and styles of navbar component.

You can customize the theme and styles of navbar component by adding Tailwind CSS classes as key paired values for objects.



Navbar Theme Object Type

interface NavbarStylesType {
  defaultProps: {
    variant: string;
    color: string;
    shadow: boolean;
    blurred: boolean;
    fullWidth: boolean;
    className: string;
  };
  valid: {
    variants: string[];
    colors: string[];
  };
  styles: {
    base: {
      navbar: {
        initial: object;
        shadow: object;
        blurred: object;
        fullWidth: object;
      };
      mobileNav: object;
    };
    variants: {
      filled: object;
      gradient: object;
    };
  };
}


For TypeScript Only

import type { NavbarStylesType } from "@material-tailwind/react";

Navbar Theme Customization

const theme = {
  navbar: {
    styles: {
      base: {
        initial: {
          display: "flex",
          flexWrap: "flex-nowrap",
          justifyContent: "justify-start",
        },
      },
    },
  },
};
Edit this page on Github