Use our AstroLaunch UI Breadcrumbs
component to simply create beautiful breadcrumbs for your pages with AstroLaunch UI.
Breadcrumbs are website links that allow users to track where they are on a website and how far they are from the homepage. They are highly important elements for your search engine optimisation (SEO) and user experience.
See below our versatile breadcrumbs component example that you can use in your AstroLaunch UI and React project.
Preview
Code
You can add any type of icon for the Breadcrumbs
component as easy as using icon in html.
Preview
Code
A Breadcrumbs
could be a block level component as well that get's all the available space in a row. You can render a Breadcrumbs
as a block level element using the fullWidth
prop.
Preview
Code
You can modify the Breadcrumbs
separators by using the Separator
prop.
Preview
Code
You can use the className
prop to add custom styles to the Breadcrumbs
component.
Preview
Code
The following props are available for breadcrumbs component. These are the custom props that we've added for the breadcrumbs component and you can use all the other native props as well.
Attribute | Type | Description | Default |
---|---|---|---|
separator | node | Change breadcrumbs separator between it's elements | / |
fullWidth | boolean | Change breadcrumbs to a block level element | false |
className | string | Add custom className for breadcrumbs | '' |
children | node | Add content for breadcrumbs | No default value it's a required prop. |
import type { BreadcrumbsProps } from "@material-tailwind/react";
Learn how to customize the theme and styles for breadcrumbs component, the theme object for breadcrumbs component has two main objects:
A. The defaultProps
object for setting up the default value for props of breadcrumbs component.
B. The styles
object for customizing the theme and styles of breadcrumbs component.
You can customize the theme and styles of breadcrumbs component by adding Tailwind CSS classes as key paired values for objects.
interface BreadcrumbsStyleTypes {
defaultProps: {
separator: node;
fullWidth: boolean;
className: string;
};
styles: {
base: {
root: {
initial: object;
fullWidth: object;
};
list: object;
item: {
initial: object;
disabled: object;
};
separator: object;
};
};
}
import type { BreadcrumbsStyleTypes } from "@material-tailwind/react";
const theme = {
breadcrumbs: {
defaultProps: {
className: "",
fullWidth: false,
separator: "/",
},
styles: {
base: {
root: {
initial: {
width: "w-max",
},
fullWidth: { display: "block", width: "w-full" },
},
list: {
display: "flex",
flexWrap: "flex-wrap",
alignItems: "items-center",
width: "w-full",
bg: "bg-blue-gray-50",
bgOpacity: "bg-opacity-60",
py: "py-2",
px: "px-4",
borderRadius: "rounded-md",
},
item: {
initial: {
display: "flex",
alignItems: "items-center",
color: "text-blue-gray-900",
fontSmoothing: "antialiased",
fontFamily: "font-sans",
fontSize: "text-sm",
fontWeight: "font-normal",
lineHeight: "leading-normal",
cursor: "cursor-pointer",
transition: "transition-colors duration-300",
hover: "hover:text-light-blue-500",
},
disabled: {
pointerEvents: "pointer-events-none",
},
},
separator: {
color: "text-blue-gray-500",
fontSize: "text-sm",
fontSmoothing: "antialiased",
fontFamily: "font-sans",
fontWeight: "font-normal",
lineHeight: "leading-normal",
px: "mx-2",
pointerEvents: "pointer-events-none",
userSelcet: "select-none",
},
},
},
},
};
If you want to see more examples and properties please check the official Material Tailwind Documentation.