Skip to content
Viewership Inquire
Astro UI

Sidebar Nav.

Collapsible workspace and chat navigation with searchable history.

NavigationComponent1 dependency Beautiful UI, MIT

.md

Install

  1. Import the foundation once

    foundation.css holds the tokens every component reads.

    Layout.astro
    ---
    // src/layouts/Layout.astro
    import "../styles/foundation.css";
    ---
  2. Copy SidebarNav.astro

    Paste into src/components/viewership/sidebar-nav/

  3. Copy its dependencies

    Each in its own folder, next to this one.

  4. Use it

    Page.astro
    ---
    import SidebarNav from "../components/viewership/sidebar-nav/SidebarNav.astro";
    ---
    
    <SidebarNav />

Props 12

PropTypeDefaultDescription
workspace { key, name, monogram? } { key: "workspace", name: "Workspace" } Current workspace.
workspaces SidebarWorkspace[] · Switcher menu workspaces. Defaults to the current one.
menuActions { key, label, icon? }[] New workspace / Workspace settings / Invite team members Workspace menu actions. Sign out is always last.
items { key, label, icon?, count?, href? }[] Home / Invite users 3/10 Primary rows. `icon`: built-in name (home, invite, inbox, calendar, chart, book, settings, spark) or inner SVG. `href` makes a link.
recents { id, label, href? }[] [] Searchable chat history.
recentsLabel string "Chats" History label.
activeNav / activeRecent string · Current item. Gets aria-current="page".
newChat boolean true Show the New chat row.
footerLabel / footerHref string | null "Upgrade" Footer button. null hides it.
collapsed boolean false Start as the 52px rail.
fill / height boolean / string false / "600px" Fill parent height, or fixed height.
Events CustomEvent · vs-sidebar-navigate { key }, vs-sidebar-pick { id, label }, vs-sidebar-new-chat, vs-sidebar-toggle { collapsed }, vs-sidebar-workspace { key }, vs-sidebar-menu { action }, vs-sidebar-footer.

Source 1 file

Ported from Beautiful UI, MIT. Notices.