feat: adding Sidebar and SidebarItem

This commit is contained in:
2026-06-23 12:35:12 +02:00
parent 1878ec3a0e
commit 1d9001705f
3 changed files with 113 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
---
export interface Props {
href?: string;
active?: boolean;
}
const { href = "#", active = false } = Astro.props;
const hasIcon = Astro.slots.has("icon");
---
<a href={href} class={`sidebar__item ${active ? "sidebar__item--active" : ""}`}>
{
hasIcon && (
<span class="sidebar__item-icon">
<slot name="icon" />
</span>
)
}
<span class="sidebar__item-label"><slot /></span>
</a>
<style lang="scss">
@use "./_sidebar.scss";
</style>