UIPackage
Menu

Framework

Change language

Boilerplate repo

Documentation Sidebar

blocklayout

Docs-style sidebar with a version switcher at the top, a search input below, and collapsible navigation groups. All sample data inlined so consumers edit routes in place.

Also available for React ->

Installation

$npx shadcn-vue@latest add https://uipkge.dev/r/vue/sidebar-03.json
Named registry:npx shadcn-vue@latest add @uipkge/sidebar-03Installs to:app/components/blocks/sidebar-03/

Variants

Loading interactive previews…

Files installed (3)

  • app/components/blocks/sidebar-03/Sidebar03.vue4.3 kB
    <script setup lang="ts">
    import { ChevronRight } from 'lucide-vue-next'
    import SearchForm from './SearchForm.vue'
    import VersionSwitcher from './VersionSwitcher.vue'
    import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'
    import {
      Sidebar,
      SidebarContent,
      SidebarGroup,
      SidebarGroupContent,
      SidebarGroupLabel,
      SidebarHeader,
      SidebarMenu,
      SidebarMenuButton,
      SidebarMenuItem,
      SidebarRail,
    } from '@/components/ui/sidebar'
    
    // This is sample data.
    const data = {
      versions: ['1.0.1', '1.1.0-alpha', '2.0.0-beta1'],
      navMain: [
        {
          title: 'Getting Started',
          url: '#',
          items: [
            {
              title: 'Installation',
              url: '#',
            },
            {
              title: 'Project Structure',
              url: '#',
            },
          ],
        },
        {
          title: 'Building Your Application',
          url: '#',
          items: [
            {
              title: 'Routing',
              url: '#',
            },
            {
              title: 'Data Fetching',
              url: '#',
              isActive: true,
            },
            {
              title: 'Rendering',
              url: '#',
            },
            {
              title: 'Caching',
              url: '#',
            },
            {
              title: 'Styling',
              url: '#',
            },
            {
              title: 'Optimizing',
              url: '#',
            },
            {
              title: 'Configuring',
              url: '#',
            },
            {
              title: 'Testing',
              url: '#',
            },
            {
              title: 'Authentication',
              url: '#',
            },
            {
              title: 'Deploying',
              url: '#',
            },
            {
              title: 'Upgrading',
              url: '#',
            },
            {
              title: 'Examples',
              url: '#',
            },
          ],
        },
        {
          title: 'API Reference',
          url: '#',
          items: [
            {
              title: 'Components',
              url: '#',
            },
            {
              title: 'File Conventions',
              url: '#',
            },
            {
              title: 'Functions',
              url: '#',
            },
            {
              title: 'next.config.js Options',
              url: '#',
            },
            {
              title: 'CLI',
              url: '#',
            },
            {
              title: 'Edge Runtime',
              url: '#',
            },
          ],
        },
        {
          title: 'Architecture',
          url: '#',
          items: [
            {
              title: 'Accessibility',
              url: '#',
            },
            {
              title: 'Fast Refresh',
              url: '#',
            },
            {
              title: 'Next.js Compiler',
              url: '#',
            },
            {
              title: 'Supported Browsers',
              url: '#',
            },
            {
              title: 'Turbopack',
              url: '#',
            },
          ],
        },
        {
          title: 'Community',
          url: '#',
          items: [
            {
              title: 'Contribution Guide',
              url: '#',
            },
          ],
        },
      ],
    }
    </script>
    
    <template>
      <Sidebar data-slot="sidebar-03">
        <SidebarHeader>
          <VersionSwitcher :versions="data.versions" :default-version="data.versions[0]!" />
          <SearchForm />
        </SidebarHeader>
        <SidebarContent class="gap-0">
          <Collapsible
            v-for="item in data.navMain"
            :key="item.title"
            :title="item.title"
            default-open
            class="group/collapsible"
          >
            <SidebarGroup>
              <SidebarGroupLabel
                as-child
                class="group/label text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground text-sm"
              >
                <CollapsibleTrigger>
                  {{ item.title }}
                  <ChevronRight class="ml-auto transition-transform group-data-[state=open]/collapsible:rotate-90" />
                </CollapsibleTrigger>
              </SidebarGroupLabel>
              <CollapsibleContent>
                <SidebarGroupContent>
                  <SidebarMenu>
                    <SidebarMenuItem v-for="childItem in item.items" :key="childItem.title">
                      <SidebarMenuButton as-child :is-active="childItem.isActive">
                        <a :href="item.url">{{ childItem.title }}</a>
                      </SidebarMenuButton>
                    </SidebarMenuItem>
                  </SidebarMenu>
                </SidebarGroupContent>
              </CollapsibleContent>
            </SidebarGroup>
          </Collapsible>
        </SidebarContent>
        <SidebarRail />
      </Sidebar>
    </template>
    
  • app/components/blocks/sidebar-03/SearchForm.vue0.7 kB
  • app/components/blocks/sidebar-03/VersionSwitcher.vue2.1 kB

Raw manifest:https://uipkge.dev/r/vue/sidebar-03.json