Layout

SidebarRightContainer

A pre-built layout wrapper with main content on the left (3/4 width) and a sidebar on the right (1/4 width). Perfect for supplementary information, quick actions, or metadata.

Basic Examples

1. Basic Sidebar Layout

Main Content

3/4 width main content area

Sidebar

1/4 width sidebar content

basic-sidebar-layout
---
import SidebarRightContainer from '@alfadormx/blocks/layout/SidebarRightContainer.astro';
---

<SidebarRightContainer
  htmlTag="section"
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-8' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  spacing={{ margin: 'mb-8' }}
>
  <div slot="main" class="bg-success text-background p-6 rounded">
    <p class="font-semibold">Main Content</p>
    <p>3/4 width main content area</p>
  </div>
  <div slot="sidebar" class="bg-primary text-background p-6 rounded">
    <p class="font-semibold">Sidebar</p>
    <p>1/4 width sidebar content</p>
  </div>
</SidebarRightContainer>

2. Content with Quick Actions

Project Details

This is a comprehensive overview of the current project status, including milestones, deliverables, and team assignments.

8
Tasks Completed
5
In Progress
12
Pending

Actions

content-with-quick-actions
---
import SidebarRightContainer from '@alfadormx/blocks/layout/SidebarRightContainer.astro';
import Button from '@alfadormx/blocks/primitives/Button.astro';
import Headline from '@alfadormx/blocks/primitives/Headline.astro';
---

<SidebarRightContainer
  htmlTag="section"
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-12' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  spacing={{ margin: 'mb-8' }}
>
  <div slot="main" class="bg-surface p-6 rounded border border-border">
    <Headline title="Project Details" htmlTag="h4" class="my-0" titleClass="mb-4 text-2xl" />
    <p>
      This is a comprehensive overview of the current project status, including milestones,
      deliverables, and team assignments.
    </p>
    <div class="grid grid-cols-3 gap-4 mt-6">
      <div class="bg-primary text-background p-4 rounded">
        <div class="text-2xl font-bold">8</div>
        <div class="text-sm">Tasks Completed</div>
      </div>
      <div class="bg-warning text-background p-4 rounded">
        <div class="text-2xl font-bold">5</div>
        <div class="text-sm">In Progress</div>
      </div>
      <div class="bg-tertiary text-background p-4 rounded">
        <div class="text-2xl font-bold">12</div>
        <div class="text-sm">Pending</div>
      </div>
    </div>
  </div>
  <div slot="sidebar" class="bg-surface border border-border p-6 rounded">
    <Headline title="Actions" htmlTag="h4" class="my-0" titleClass="mb-4 text-lg" />
    <nav class="space-y-2">
      <Button label="Edit Project" variant="ghost" width="full" class="justify-start" />
      <Button label="Add Task" variant="ghost" width="full" class="justify-start" />
      <Button label="Assign Team" variant="ghost" width="full" class="justify-start" />
      <Button label="Export Report" variant="ghost" width="full" class="justify-start" />
    </nav>
  </div>
</SidebarRightContainer>

3. Content with Metadata Sidebar

Article Title: Modern Web Development

The landscape of web development has changed dramatically over the past few years. Modern frameworks, tools, and best practices have emerged to help developers build better applications faster.

From component-based architectures to server-side rendering, the ecosystem continues to evolve. Understanding these patterns is essential for building scalable, maintainable applications.

Performance optimization, accessibility, and user experience remain critical factors in successful web development projects.

Metadata

Author:
Jane Smith
Published:
Dec 25, 2025
Category:
Technology
Reading Time:
5 min

Tags

JavaScriptReactAstro
content-with-metadata-sidebar
---
import SidebarRightContainer from '@alfadormx/blocks/layout/SidebarRightContainer.astro';
import Headline from '@alfadormx/blocks/primitives/Headline.astro';
---

<SidebarRightContainer
  htmlTag="section"
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-12' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  spacing={{ margin: 'mb-8' }}
>
  <div slot="main" class="bg-surface p-6 rounded border border-border">
    <Headline
      title="Article Title: Modern Web Development"
      htmlTag="h4"
      class="my-0"
      titleClass="mb-4 text-2xl"
    />
    <p>
      The landscape of web development has changed dramatically over the past few years. Modern
      frameworks, tools, and best practices have emerged to help developers build better
      applications faster.
    </p>
    <p>
      From component-based architectures to server-side rendering, the ecosystem continues to
      evolve. Understanding these patterns is essential for building scalable, maintainable
      applications.
    </p>
    <p>
      Performance optimization, accessibility, and user experience remain critical factors in
      successful web development projects.
    </p>
  </div>
  <div slot="sidebar" class="space-y-4">
    <div class="bg-primary text-background p-4 rounded border border-primary">
      <Headline
        title="Metadata"
        htmlTag="h4"
        class="my-0"
        titleClass="mb-2 text-lg text-background"
      />
      <dl class="text-sm space-y-1">
        <div>
          <dt>Author:</dt>
          <dd class="font-medium">Jane Smith</dd>
        </div>
        <div>
          <dt>Published:</dt>
          <dd class="font-medium">Dec 25, 2025</dd>
        </div>
        <div>
          <dt>Category:</dt>
          <dd class="font-medium">Technology</dd>
        </div>
        <div>
          <dt>Reading Time:</dt>
          <dd class="font-medium">5 min</dd>
        </div>
      </dl>
    </div>
    <div class="bg-success/10 p-4 rounded border border-success">
      <Headline title="Tags" htmlTag="h4" class="my-0" titleClass="mb-2 text-lg text-success" />
      <div class="flex flex-wrap gap-2">
        <span class="px-2 py-1 bg-success text-background text-xs rounded">JavaScript</span>
        <span class="px-2 py-1 bg-success text-background text-xs rounded">React</span>
        <span class="px-2 py-1 bg-success text-background text-xs rounded">Astro</span>
      </div>
    </div>
  </div>
</SidebarRightContainer>

4. With Background Gradient

Premium Features

Unlock advanced capabilities designed for power users and teams. Get access to exclusive features that streamline your workflow.

  • ✓ Advanced analytics and reporting
  • ✓ Priority customer support
  • ✓ Custom integrations
  • ✓ Team collaboration tools
with-background-gradient
---
import SidebarRightContainer from '@alfadormx/blocks/layout/SidebarRightContainer.astro';
import Button from '@alfadormx/blocks/primitives/Button.astro';
import Headline from '@alfadormx/blocks/primitives/Headline.astro';
---

<SidebarRightContainer
  htmlTag="section"
  containerWidthType="full"
  background={{ class: 'bg-linear-to-r from-info to-primary' }}
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-12' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  spacing={{ margin: 'mb-8' }}
>
  <div slot="main" class="bg-surface/90 backdrop-blur p-6 rounded shadow-lg">
    <Headline title="Premium Features" htmlTag="h4" class="my-0" titleClass="mb-4 text-2xl" />
    <p>
      Unlock advanced capabilities designed for power users and teams. Get access to exclusive
      features that streamline your workflow.
    </p>
    <ul>
      <li>✓ Advanced analytics and reporting</li>
      <li>✓ Priority customer support</li>
      <li>✓ Custom integrations</li>
      <li>✓ Team collaboration tools</li>
    </ul>
    <Button label="Upgrade Now" intent="secondary" />
  </div>
  <div slot="sidebar" class="bg-surface/90 backdrop-blur p-6 rounded shadow-lg">
    <Headline title="Pricing" htmlTag="h4" class="my-0" titleClass="mb-4 text-lg" />
    <div class="text-center mb-4">
      <div class="text-3xl font-bold text-info">$49</div>
      <div class="text-sm text-muted">per month</div>
    </div>
    <ul class="space-y-2 text-sm">
      <li>
        <a href="#" class="text-muted hover:underline">
          Compare Plans
        </a>
      </li>
      <li>
        <a href="#" class="text-muted hover:underline">
          FAQ
        </a>
      </li>
      <li>
        <a href="#" class="text-muted hover:underline">
          Contact Sales
        </a>
      </li>
    </ul>
  </div>
</SidebarRightContainer>

5. Responsive (Stacks on Mobile)

Main Content

Main content appears first on mobile.

Sidebar

This sidebar appears below on mobile devices.

responsive-stacks-on-mobile
---
import SidebarRightContainer from '@alfadormx/blocks/layout/SidebarRightContainer.astro';
---

<SidebarRightContainer
  htmlTag="section"
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-8' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  responsive={true}
  spacing={{ margin: 'mb-8' }}
>
  <div slot="main" class="bg-error text-background p-6 rounded">
    <p class="font-semibold text-lg font-bold mb-2">Main Content</p>
    <p class="text-sm">Main content appears first on mobile.</p>
  </div>
  <div slot="sidebar" class="bg-accent text-background p-6 rounded">
    <p class="font-semibold text-lg font-bold mb-2">Sidebar</p>
    <p class="text-sm">This sidebar appears below on mobile devices.</p>
  </div>
</SidebarRightContainer>

Practical Use Cases

6. Documentation Page

API Authentication Guide

Last updated: December 25, 2025

Learn how to authenticate your API requests securely using our authentication system. This guide covers OAuth 2.0, API keys, and best practices for secure integration.

Getting Started

Before making API calls, you'll need to obtain credentials from your developer dashboard. Choose the authentication method that best fits your use case.

API Keys

API keys are simple to use and perfect for server-to-server communication. Keep your keys secure and never expose them in client-side code.

Note: API v1 will be deprecated on June 1, 2026.

documentation-page
---
import SidebarRightContainer from '@alfadormx/blocks/layout/SidebarRightContainer.astro';
import Headline from '@alfadormx/blocks/primitives/Headline.astro';
---

<SidebarRightContainer
  htmlTag="section"
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-12' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  gap="loose"
  spacing={{ margin: 'mb-8' }}
>
  <div slot="main" class="bg-surface p-8 rounded border border-border">
    <Headline
      title="API Authentication Guide"
      htmlTag="h4"
      class="my-0"
      titleClass="mb-4 text-3xl"
    />
    <div class="text-sm text-muted mb-6">Last updated: December 25, 2025</div>
    <p>
      Learn how to authenticate your API requests securely using our authentication system. This
      guide covers OAuth 2.0, API keys, and best practices for secure integration.
    </p>
    <Headline title="Getting Started" htmlTag="h4" class="mt-6 mb-0" titleClass="mb-2 text-xl" />
    <p>
      Before making API calls, you'll need to obtain credentials from your developer dashboard.
      Choose the authentication method that best fits your use case.
    </p>
    <Headline title="API Keys" htmlTag="h4" class="mt-6 mb-0" titleClass="mb-2 text-xl" />
    <p>
      API keys are simple to use and perfect for server-to-server communication. Keep your keys
      secure and never expose them in client-side code.
    </p>
  </div>
  <div slot="sidebar" class="space-y-6">
    <div class="bg-surface p-6 rounded border border-border">
      <Headline title="On This Page" htmlTag="h4" class="my-0" titleClass="mb-3 text-lg" />
      <ul class="space-y-2">
        <li>
          <a href="#" class="text-sm text-link hover:underline">
            Getting Started
          </a>
        </li>
        <li>
          <a href="#" class="text-sm text-link hover:underline">
            API Keys
          </a>
        </li>
        <li>
          <a href="#" class="text-sm text-link hover:underline">
            OAuth 2.0
          </a>
        </li>
        <li>
          <a href="#" class="text-sm text-link hover:underline">
            Best Practices
          </a>
        </li>
      </ul>
    </div>
    <div class="bg-surface p-6 rounded border border-border">
      <Headline title="Related Docs" htmlTag="h4" class="my-0" titleClass="mb-3 text-lg" />
      <ul class="space-y-2">
        <li>
          <a href="#" class="text-sm text-link hover:underline">
            Rate Limiting
          </a>
        </li>
        <li>
          <a href="#" class="text-sm text-link hover:underline">
            Error Handling
          </a>
        </li>
        <li>
          <a href="#" class="text-sm text-link hover:underline">
            Webhooks
          </a>
        </li>
      </ul>
    </div>
    <div class="bg-warning/10 p-4 rounded border border-warning">
      <p class="text-xs text-normal">
        <strong>Note:</strong> API v1 will be deprecated on June 1, 2026.
      </p>
    </div>
  </div>
</SidebarRightContainer>

API Reference

PropTypeDefaultDescription
gapGridGap'normal'Gap between columns, responsive (default: 'normal')
responsivebooleanfalseResponsive behavior (default: false - always side-by-side)
breakpointstring'md:'Responsive breakpoint (default: 'md:' - use 'sm:', 'lg:', etc.)
sidebarCellProps—Configuration for the sidebar column
mainContentCellProps—Configuration for the main content column