Sidebar with sections

Item
Item
Item
Section
Item
Item
Item
Section
Item
Item
Item
A
IrvinFounder
Properties
No properties to configure
Example
Source Code
Installation
"use client";

import React from "react";
import { Avatar } from "@/subframe/components/Avatar";
import { IconButton } from "@/subframe/components/IconButton";
import { SidebarWithSections } from "@/subframe/components/SidebarWithSections";

function SidebarWithSectionsExample() {
  return (
    <SidebarWithSections
      header={
        <img
          className="h-6 flex-none object-cover"
          src="https://res.cloudinary.com/subframe/image/upload/v1711417507/shared/y2rsnhq3mex4auk54aye.png"
        />
      }
      footer={
        <>
          <div className="flex grow shrink-0 basis-0 items-start gap-2">
            <Avatar image="https://res.cloudinary.com/subframe/image/upload/v1711417513/shared/kwut7rhuyivweg8tmyzl.jpg">
              A
            </Avatar>
            <div className="flex flex-col items-start">
              <span className="text-caption-bold font-caption-bold text-default-font">
                Irvin
              </span>
              <span className="text-caption font-caption text-subtext-color">
                Founder
              </span>
            </div>
          </div>
          <IconButton
            size="small"
            icon="FeatherMoreHorizontal"
            onClick={(event: React.MouseEvent<HTMLButtonElement>) => {}}
          />
        </>
      }
    >
      <SidebarWithSections.NavItem selected={true}>
        Item
      </SidebarWithSections.NavItem>
      <SidebarWithSections.NavItem>Item</SidebarWithSections.NavItem>
      <SidebarWithSections.NavItem>Item</SidebarWithSections.NavItem>
      <SidebarWithSections.NavSection label="Section">
        <SidebarWithSections.NavItem>Item</SidebarWithSections.NavItem>
        <SidebarWithSections.NavItem>Item</SidebarWithSections.NavItem>
        <SidebarWithSections.NavItem>Item</SidebarWithSections.NavItem>
      </SidebarWithSections.NavSection>
      <SidebarWithSections.NavSection label="Section">
        <SidebarWithSections.NavItem>Item</SidebarWithSections.NavItem>
        <SidebarWithSections.NavItem>Item</SidebarWithSections.NavItem>
        <SidebarWithSections.NavItem>Item</SidebarWithSections.NavItem>
      </SidebarWithSections.NavSection>
    </SidebarWithSections>
  );
}

export default SidebarWithSectionsExample;

Props

Sidebar with sections
Nav Item
Nav Section
Prop
Type
Default
Additional info
header
React.ReactNode
footer
React.ReactNode
children
React.ReactNode