Skip to content

SidebarMenuBadge

Source: client/lib/theme/vueda-tailwind/navigation/index.js

Count or status badge anchored to a menu button. Tone handling stays local to sidebar tokens and hides in icon-collapsed mode.

Vue component: SidebarMenuBadge

SlotDefault classesDescription
rootcallbackCount or status badge anchored to a menu button. Tone handling stays local to sidebar tokens and hides in icon-collapsed mode.

root

Count or status badge anchored to a menu button. Tone handling stays local to sidebar tokens and hides in icon-collapsed mode.

Callback:

javascript
({ tone }) => ({
            class: [
                // Positioning and layout.
                "pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-vueda-control px-1",

                // Type.
                "font-mono text-[length:var(--vueda-text-micro)] font-semibold tabular-nums select-none",

                // Size alignment.
                "peer-data-[size=sm]/menu-button:top-1",
                "peer-data-[size=default]/menu-button:top-1.5",
                "peer-data-[size=lg]/menu-button:top-2.5",

                // Tone classes.
                {
                    "bg-sidebar-accent text-sidebar-foreground peer-data-[active=true]/menu-button:bg-[color-mix(in_oklab,var(--sidebar-primary)_14%,transparent)] peer-data-[active=true]/menu-button:text-sidebar-primary":
                        !tone || tone === "neutral",
                    "bg-[color-mix(in_oklab,var(--sidebar-primary)_14%,transparent)] text-sidebar-primary":
                        tone === "primary",
                    "bg-[color-mix(in_oklab,var(--destructive)_14%,transparent)] text-destructive":
                        tone === "destructive",
                },

                // Collapsed state.
                "group-data-[collapsible=icon]:hidden",
            ],
        })

Source: client/lib/theme/vueda-tailwind/navigation/SidebarMenuBadge.theme.js:16

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2