EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
Layout·component·@astryxdesign/core

Layout Content

Scrollable main content area.

Open in Playground @astryxdesign/core/Layout

Showcases and examples

2 documented examples

Layout Content

LayoutContent is the scrollable main content area within a Layout, providing automatic padding and scroll containment between the header and footer.

Preview loads on approachPreview loads on approach
Exact source · layout-content-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {
  Layout,
  LayoutContent,
  LayoutHeader,
  LayoutFooter,
  LayoutPanel,
  Card,
  VStack,
} from '@astryxdesign/core/Layout';
import {Center} from '@astryxdesign/core/Center';
import {Text, Heading} from '@astryxdesign/core/Text';

export default function LayoutContentShowcase() {
  return (
    <Center width={500}>
      <Layout
        style={{width: '100%'}}
        height="fill"
        header={
          <LayoutHeader hasDivider>
            <Card variant="muted" />
          </LayoutHeader>
        }
        start={
          <LayoutPanel hasDivider width={140}>
            <Card variant="muted" />
          </LayoutPanel>
        }
        content={
          <LayoutContent role="main">
            <VStack gap={3}>
              <Heading level={5}>Main Content Area</Heading>
              <Text type="body" color="secondary">
                LayoutContent provides automatic padding and scroll containment.
                It fills the remaining space between the header and footer.
              </Text>
              <Text type="body" color="secondary">
                Content that overflows will scroll within this area while the
                header and footer remain fixed.
              </Text>
            </VStack>
          </LayoutContent>
        }
        footer={
          <LayoutFooter hasDivider>
            <Card variant="muted" />
          </LayoutFooter>
        }
      />
    </Center>
  );
}

Usage

Scrollable main content area.

Typed props

PropType and behavior
childrenReactNode
Content.
padding0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10
Internal padding using the spacing scale. Overrides the default padding from the layout container.
isScrollableboolean · default true
Enable scrollable overflow. With arithmetic contentWidth values, the scrollport spans through every open side while context-aware insets keep children aligned.
labelstring
Accessible label for the landmark element.
roleAriaRole
ARIA landmark role.