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 +}))