# Sidebar Layout

> Sidebar Layout for Settings.

A shadcn/ui block from the [@flx](https://ui.flexnative.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/flx/settings-2).

- Page, with a live preview: https://shadcn.exchange/r/flx/settings-2
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/flx/settings-2-light-6869653eb905ee1d.png
- Registry item: https://ui.flexnative.com/r/settings-2.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.flexnative.com/r/settings-2.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `lucide-react`
- Registry items: `button`, `card`, `input`, `label`, `separator`, `sidebar`, `switch`

## Files

### `registry/intents/account/settings/settings-2.tsx`

```tsx
'use client'

import type { CSSProperties } from 'react'
import { Bell, CreditCard, Lock, Plug, User, Users } from 'lucide-react'

import { Button } from '@/components/ui/button'
import { Card } from '@/components/ui/card'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { Separator } from '@/components/ui/separator'
import {
  Sidebar,
  SidebarContent,
  SidebarGroup,
  SidebarGroupLabel,
  SidebarHeader,
  SidebarMenu,
  SidebarMenuButton,
  SidebarMenuItem,
  SidebarProvider,
} from '@/components/ui/sidebar'
import { Switch } from '@/components/ui/switch'

const nav = [
  { icon: User, label: 'Profile', active: true },
  { icon: Lock, label: 'Security' },
  { icon: Bell, label: 'Notifications' },
  { icon: CreditCard, label: 'Billing' },
  { icon: Users, label: 'Team' },
  { icon: Plug, label: 'Integrations' },
]

export function Settings2() {
  return (
    <Card className="p-0">
      <SidebarProvider
        className="h-[420px] min-h-0"
        style={{ '--sidebar-width': '13rem' } as CSSProperties}
      >
        <Sidebar collapsible="none" className="hidden border-r sm:flex">
          <SidebarHeader>
            <div className="flex items-center gap-2 px-2 py-1.5">
              <div className="bg-primary/15 text-primary flex size-7 items-center justify-center rounded-md text-xs font-semibold">
                AL
              </div>
              <span className="text-sm font-medium">Acme Inc</span>
            </div>
          </SidebarHeader>
          <SidebarContent>
            <SidebarGroup>
              <SidebarGroupLabel>Settings</SidebarGroupLabel>
              <SidebarMenu>
                {nav.map(({ icon: Icon, label, active }) => (
                  <SidebarMenuItem key={label}>
                    <SidebarMenuButton isActive={active}>
                      <Icon />
                      {label}
                    </SidebarMenuButton>
                  </SidebarMenuItem>
                ))}
              </SidebarMenu>
            </SidebarGroup>
          </SidebarContent>
        </Sidebar>

        <main className="flex flex-1 flex-col gap-6 overflow-auto p-6">
          <div>
            <h3 className="text-base font-semibold">Profile</h3>
            <p className="text-muted-foreground text-sm">
              Update how others see you across the workspace.
            </p>
          </div>

          <div className="grid gap-4 sm:grid-cols-2">
            <div className="flex flex-col gap-1.5">
              <Label htmlFor="sl-name">Full name</Label>
              <Input id="sl-name" defaultValue="Ada Lovelace" />
            </div>
            <div className="flex flex-col gap-1.5">
              <Label htmlFor="sl-role">Role</Label>
              <Input id="sl-role" defaultValue="Engineering Lead" />
            </div>
          </div>

          <Separator />

          <div className="flex items-center justify-between">
            <div className="flex flex-col gap-0.5">
              <span className="text-sm font-medium">Show online status</span>
              <span className="text-muted-foreground text-xs">
                Let teammates see when you are active.
              </span>
            </div>
            <Switch defaultChecked />
          </div>

          <div className="flex justify-end">
            <Button>Save changes</Button>
          </div>
        </main>
      </SidebarProvider>
    </Card>
  )
}
```
