diff --git a/docs/content/docs/2.components/breadcrumb.md b/docs/content/docs/2.components/breadcrumb.md
index e4d96871ff..37f1616302 100644
--- a/docs/content/docs/2.components/breadcrumb.md
+++ b/docs/content/docs/2.components/breadcrumb.md
@@ -112,6 +112,33 @@ You can customize this icon globally in your `vite.config.ts` under `ui.icons.ch
:::
::
+### Color :badge{label="Soon" class="align-text-top"}
+
+Use the `color` prop to change the color of the active Breadcrumb.
+
+::component-code
+---
+ignore:
+ - items
+external:
+ - items
+externalTypes:
+ - BreadcrumbItem[]
+props:
+ color: 'secondary'
+ items:
+ - label: 'Docs'
+ icon: 'i-lucide-book-open'
+ to: '/docs'
+ - label: 'Components'
+ icon: 'i-lucide-box'
+ to: '/docs/components'
+ - label: 'Breadcrumb'
+ icon: 'i-lucide-link'
+ to: '/docs/components/breadcrumb'
+---
+::
+
## Examples
### With separator slot
diff --git a/playgrounds/nuxt/app/pages/components/breadcrumb.vue b/playgrounds/nuxt/app/pages/components/breadcrumb.vue
index cdbcc4d289..21ba6aea0c 100644
--- a/playgrounds/nuxt/app/pages/components/breadcrumb.vue
+++ b/playgrounds/nuxt/app/pages/components/breadcrumb.vue
@@ -1,4 +1,12 @@
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/src/runtime/components/Breadcrumb.vue b/src/runtime/components/Breadcrumb.vue
index ba1dbb3cfa..9e0104b0e2 100644
--- a/src/runtime/components/Breadcrumb.vue
+++ b/src/runtime/components/Breadcrumb.vue
@@ -35,6 +35,10 @@ export interface BreadcrumbProps {
* @IconifyIcon
*/
separatorIcon?: IconProps['name']
+ /**
+ * @defaultValue 'primary'
+ */
+ color?: Breadcrumb['variants']['color']
/**
* The key used to get the label from the item.
* @defaultValue 'label'
@@ -84,8 +88,9 @@ const uiProp = useComponentUI('breadcrumb', props)
const separatorIcon = computed(() => props.separatorIcon || (dir.value === 'rtl' ? appConfig.ui.icons.chevronLeft : appConfig.ui.icons.chevronRight))
-// eslint-disable-next-line vue/no-dupe-keys
-const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.breadcrumb || {}) })())
+const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.breadcrumb || {}) })({
+ color: props.color
+}))
diff --git a/src/theme/breadcrumb.ts b/src/theme/breadcrumb.ts
index 059285fa80..3f484a21ac 100644
--- a/src/theme/breadcrumb.ts
+++ b/src/theme/breadcrumb.ts
@@ -5,7 +5,7 @@ export default (options: Required) => ({
root: 'relative min-w-0',
list: 'flex items-center gap-1.5',
item: 'flex min-w-0',
- link: 'group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-primary',
+ link: 'group relative flex items-center gap-1.5 text-sm min-w-0',
linkLeadingIcon: 'shrink-0 size-5',
linkLeadingAvatar: 'shrink-0',
linkLeadingAvatarSize: '2xs',
@@ -16,7 +16,7 @@ export default (options: Required) => ({
variants: {
active: {
true: {
- link: 'text-primary font-semibold'
+ link: 'font-semibold'
},
false: {
link: 'text-muted font-medium'
@@ -29,6 +29,10 @@ export default (options: Required) => ({
},
to: {
true: ''
+ },
+ color: {
+ ...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, { link: `focus-visible:outline-${color}` }])),
+ neutral: ''
}
},
compoundVariants: [{
@@ -38,5 +42,14 @@ export default (options: Required) => ({
class: {
link: ['hover:text-default', options.theme.transitions && 'transition-colors']
}
- }]
+ }, ...(options.theme.colors || []).map((color: string) => ({
+ color,
+ active: true,
+ class: {
+ link: `text-${color}`
+ }
+ }))],
+ defaultVariants: {
+ color: 'primary'
+ }
})
diff --git a/test/components/Breadcrumb.spec.ts b/test/components/Breadcrumb.spec.ts
index b8eea2c300..86882f20b0 100644
--- a/test/components/Breadcrumb.spec.ts
+++ b/test/components/Breadcrumb.spec.ts
@@ -30,6 +30,7 @@ describe('Breadcrumb', () => {
['with items', { props }],
['with labelKey', { props: { ...props, labelKey: 'icon' } }],
['with separatorIcon', { props: { ...props, separatorIcon: 'i-lucide-minus' } }],
+ ['with color', { props: { ...props, color: 'secondary' } }],
['with as', { props: { ...props, as: 'div' } }],
['with class', { props: { ...props, class: 'w-48' } }],
['with ui', { props: { ...props, ui: { link: 'font-bold' } } }],
diff --git a/test/components/__snapshots__/Breadcrumb-vue.spec.ts.snap b/test/components/__snapshots__/Breadcrumb-vue.spec.ts.snap
index 1755ddf7eb..75f65ac0d9 100644
--- a/test/components/__snapshots__/Breadcrumb-vue.spec.ts.snap
+++ b/test/components/__snapshots__/Breadcrumb-vue.spec.ts.snap
@@ -3,11 +3,11 @@
exports[`Breadcrumb > renders with as correctly 1`] = `
""
@@ -16,11 +16,24 @@ exports[`Breadcrumb > renders with as correctly 1`] = `
exports[`Breadcrumb > renders with class correctly 1`] = `
""
+`;
+
+exports[`Breadcrumb > renders with color correctly 1`] = `
+""
@@ -29,11 +42,11 @@ exports[`Breadcrumb > renders with class correctly 1`] = `
exports[`Breadcrumb > renders with custom slot correctly 1`] = `
""
@@ -42,11 +55,11 @@ exports[`Breadcrumb > renders with custom slot correctly 1`] = `
exports[`Breadcrumb > renders with item slot correctly 1`] = `
""
@@ -55,11 +68,11 @@ exports[`Breadcrumb > renders with item slot correctly 1`] = `
exports[`Breadcrumb > renders with item-label slot correctly 1`] = `
""
@@ -68,11 +81,11 @@ exports[`Breadcrumb > renders with item-label slot correctly 1`] = `
exports[`Breadcrumb > renders with item-leading slot correctly 1`] = `
""
@@ -81,11 +94,11 @@ exports[`Breadcrumb > renders with item-leading slot correctly 1`] = `
exports[`Breadcrumb > renders with item-trailing slot correctly 1`] = `
""
@@ -94,11 +107,11 @@ exports[`Breadcrumb > renders with item-trailing slot correctly 1`] = `
exports[`Breadcrumb > renders with items correctly 1`] = `
""
@@ -107,13 +120,13 @@ exports[`Breadcrumb > renders with items correctly 1`] = `
exports[`Breadcrumb > renders with labelKey correctly 1`] = `
""
@@ -122,11 +135,11 @@ exports[`Breadcrumb > renders with labelKey correctly 1`] = `
exports[`Breadcrumb > renders with separator slot correctly 1`] = `
""
@@ -135,11 +148,11 @@ exports[`Breadcrumb > renders with separator slot correctly 1`] = `
exports[`Breadcrumb > renders with separatorIcon correctly 1`] = `
""
@@ -148,9 +161,9 @@ exports[`Breadcrumb > renders with separatorIcon correctly 1`] = `
exports[`Breadcrumb > renders with ui correctly 1`] = `
"