Breadcrumb

@sgroup/tailwind-plugins/breadcrumb

Since breadcrumbs provide a navigation, it’s a good idea to add a meaningful label such as aria-label="breadcrumb" to describe the type of navigation provided in the <nav> element, as well as applying an aria-current="page" to the last item of the set to indicate that it represents the current page.

The dividers are automatically created in the content of the ::before pseudo-element of li tags.

Long breadcrumb items can also automatically collapse into ellipsis ....

Collapse

Additionally, breadcrumbs will automatically collapse on mobile.

Responsiveness

Configuration

Configure the @sgroup/tailwind-plugins/breadcrumb plugin.

module.exports = {
   plugins: [
       require('@sgroup/tailwind-plugins/breadcrumb')({
           delimiter: '-',
       }),
   ],
};

Available options

OptionTypeDefaultDescription
delimiterString/What string to use to separate breadcrumbs.
delimiterColorStringtextColor.gray.500The dot-notation theme option for the delimiter colour.
itemPaddingStringpadding.2The dot-notation theme option for the padding between items.
maxWidthStringmaxWidth.xsThe dot-notation theme option for max width for an item.
textOverflowStringellipsisThe text-overflow CSS property when truncated.
truncateBreakpointBreakpointsmThe breakpoint at which items that are too long are truncated.
collapseBreakpointBreakpointxsThe breakpoint at which items are hidden (apart from the first and last items).