Migrating from UIBreadcrumb to HighRise Breadcrumb
This guide will help you migrate from the ghl-ui Breadcrumb component to the new HighRise Breadcrumb component.
Component Implementation Changes
Import Changes
diff
- import { UIBreadcrumb, UIBreadcrumbItem } from '@gohighlevel/ghl-ui'
+ import { HLBreadcrumb } from '@platform-ui/highrise'
Breaking Changes
The new Breadcrumb component uses a data-driven approach instead of slot-based composition:
- Old: Slot-based with individual
UIBreadcrumbItem
components - New: Array-based using the
breadcrumbs
prop withBreadcrumbItem
interface
Props Changes
New Required Props:
id
: Required for accessibilitybreadcrumbs
: Array of breadcrumb items
New Optional Props:
home
: Boolean to show/hide home icon (default: true)size
: 'sm' | 'md' | 'lg' (default: 'lg')
Changed Props:
separator
: Still optional, but now only accepts string (default: '/')
Slots Changes
The following slots have been removed:
default
slot - Usebreadcrumbs
prop instead- Individual
UIBreadcrumbItem
components are no longer used
Examples
Basic Usage
diff
- <UIBreadcrumb>
- <UIBreadcrumbItem>Home</UIBreadcrumbItem>
- <UIBreadcrumbItem>Products</UIBreadcrumbItem>
- <UIBreadcrumbItem>Laptops</UIBreadcrumbItem>
- </UIBreadcrumb>
+ <HLBreadcrumb
+ id="example-breadcrumb"
+ :breadcrumbs="[
+ { label: 'Home', href: '/' },
+ { label: 'Products', href: '/products' },
+ { label: 'Laptops', href: '/products/laptops' }
+ ]"
+ />
With Custom Separator
diff
- <UIBreadcrumb separator=">">
- <UIBreadcrumbItem>One</UIBreadcrumbItem>
- <UIBreadcrumbItem>Two</UIBreadcrumbItem>
- <UIBreadcrumbItem>Three</UIBreadcrumbItem>
- </UIBreadcrumb>
+ <HLBreadcrumb
+ id="custom-separator-breadcrumb"
+ separator=">"
+ :breadcrumbs="[
+ { label: 'One', href: '/one' },
+ { label: 'Two', href: '/two' },
+ { label: 'Three', href: '/three' }
+ ]"
+ />
With Links and Non-clickable Items
diff
- <UIBreadcrumb>
- <UIBreadcrumbItem href="/">Home</UIBreadcrumbItem>
- <UIBreadcrumbItem href="/products">Products</UIBreadcrumbItem>
- <UIBreadcrumbItem :clickable="false">Current Page</UIBreadcrumbItem>
- </UIBreadcrumb>
+ <HLBreadcrumb
+ id="mixed-breadcrumb"
+ :breadcrumbs="[
+ { label: 'Home', href: '/' },
+ { label: 'Products', href: '/products' },
+ { label: 'Current Page', clickable: false }
+ ]"
+ />
Without Home Icon
diff
- <UIBreadcrumb>
- <UIBreadcrumbItem>Home</UIBreadcrumbItem>
- <UIBreadcrumbItem>Products</UIBreadcrumbItem>
- </UIBreadcrumb>
+ <HLBreadcrumb
+ id="no-home-breadcrumb"
+ :home="false"
+ :breadcrumbs="[
+ { label: 'Home', href: '/' },
+ { label: 'Products', href: '/products' }
+ ]"
+ />
With Overflow (4+ items)
vue
<template>
<HLBreadcrumb id="overflow-breadcrumb" :breadcrumbs="longBreadcrumbs" />
</template>
<script setup>
const longBreadcrumbs = [
{ label: 'Home', href: '/' },
{ label: 'Category', href: '/category' },
{ label: 'Subcategory', href: '/category/sub' },
{ label: 'Products', href: '/category/sub/products' },
{ label: 'Current Item' },
]
</script>
Type Definitions
typescript
interface BreadcrumbItem {
label: string
href?: string
clickable?: boolean
}
Best Practices
- Always provide unique
id
props for accessibility - Use the
home
prop to control home icon visibility - Set appropriate
size
based on your layout needs - Use
clickable: false
for the current page item - Leverage automatic overflow for long breadcrumb paths
- Keep breadcrumb labels concise and clear
- Use consistent URL structure in
href
props - Consider mobile responsiveness when setting labels
Additional Notes
- The component automatically handles overflow for 4+ items
- Home icon is shown by default but can be disabled
- The last item is typically styled differently
- Supports three size variants: 'sm', 'md', 'lg'
- Uses semantic HTML for better accessibility
- Maintains consistent spacing and alignment
- Integrates with the HighRise design system
- Provides built-in responsive behavior