Layout Components
Relevant source files This document provides API reference and construction patterns for layout components in@ui8kit/core. Layout components orchestrate multiple UI components into complete application structures such as dashboards, landing pages, and admin panels.
For basic primitive layout components (Grid, Flex, Stack), see Core Components. For UI component composition patterns, see UI Components. For general best practices on layout construction, see Best Practices.
Overview
The library provides three specialized layout components that compose primitives and UI components into application templates:
These layouts sit at Layer 3 of the architecture and build upon Layer 1 primitives (Block, Box, Grid, Container) and Layer 2 UI components (Card, Button, Text, Title).
Sources: src/layouts/DashLayout.tsx src/layouts/LayoutBlock.tsx src/layouts/SplitBlock.tsx README.md147-168
Component Relationships
DashLayout
Dashboard layout component with resizable sidebar, navbar, and main content area. Built onreact-resizable-panels for panel resizing functionality.
DashLayout Props
Navbar Sub-component
<nav> element with data-role="dash-navbar" attribute.
Implementation: src/layouts/DashLayout.tsx34-49
Sidebar Sub-component
<aside> element. Wraps children in Stack layout with optional title.
Implementation: src/layouts/DashLayout.tsx14-25
Panel Structure
Import Pattern
LayoutBlock
Flexible content section component supporting three layout modes: grid, flex, and stack. Includes content hook system for customizable rendering and default presenters for common patterns.LayoutBlock Props
Layout Modes
Content Hook System
Sources: src/layouts/LayoutBlock.tsx23-30 src/layouts/LayoutBlock.tsx229-254
Default Item Renderers
Import Pattern
SplitBlock
Two-column split layout component for hero sections and feature showcases. Supports left/right media positioning and optional container wrapping.SplitBlock Props
Layout Modes
Content Hook System
Import Pattern
Construction Patterns by Use Case
Landing Pages
Landing pages typically combine multipleLayoutBlock and SplitBlock components for hero sections, features, and CTAs.
Dashboards
Dashboards useDashLayout as the primary container with resizable sidebar for navigation.
Websites
Multi-page websites composeLayoutBlock sections with different layout modes for varied content types.
Admin Panels
Admin panels extend the dashboard pattern with form layouts and data management interfaces.Common Composition Patterns
Responsive Grid Configurations
Sources: src/layouts/LayoutBlock.tsx280-324
Content Hook Composition
Nested Layout Composition
Data Attributes for Targeting
Layout components includedata-class and data-role attributes for consistent DOM targeting:
Sources: src/layouts/DashLayout.tsx18-48 src/layouts/LayoutBlock.tsx320-345 src/layouts/SplitBlock.tsx129