Footer in shadcn sidebar not rendering correctly
Answered
American black bear posted this in #help-forum
American black bearOP
It is showing as the first image when it should be as the second one.
I am not sure what is going on. This is the code that handles this:
And another problem that i have is that DropdownMenuContent is inheriting style from sidebar. Thats why I have className="bg-popover text-popover-foreground"
I am not sure what is going on. This is the code that handles this:
export function AppSidebar() {
return (
<Sidebar>
<SidebarContent>
<SidebarGroup>
<SidebarGroupLabel>Application</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
{items.map((item) => (
<SidebarMenuItem key={item.title}>
<SidebarMenuButton asChild>
<a href={item.url}>
<item.icon />
<span>{item.title}</span>
</a>
</SidebarMenuButton>
</SidebarMenuItem>
))}
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
<SidebarFooter>
<SidebarMenu>
<SidebarMenuItem>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<SidebarMenuButton>
<User2 /> Username
<ChevronUp className="ml-auto" />
</SidebarMenuButton>
</DropdownMenuTrigger>
<DropdownMenuContent
side="top"
className="w-[--radix-popper-anchor-width] bg-popover text-popover-foreground"
>
<DropdownMenuItem>
<span>Sign out</span>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</SidebarMenuItem>
</SidebarMenu>
</SidebarFooter>
</Sidebar>
);
}
And another problem that i have is that DropdownMenuContent is inheriting style from sidebar. Thats why I have className="bg-popover text-popover-foreground"
Answered by American black bear
@American black bear are u importing them from components folder? make sure they are not imported from @radix
2 Replies
American black bear
@American black bear are u importing them from components folder? make sure they are not imported from @radix
Answer
American black bearOP
that solves it. Ty!