Pallas UI
DocsComponents
Core Concepts
    • Introduction
    • Getting Started
    • Theming
    • Color Tokens
    • Spacing & Sizing
    • Layout Guide
    • AspectRatio
    • Box
    • Flex
    • Grid
    • Shapes
Previews
    • Accordion
    • Alert
    • Avatar
    • Badge
    • Breadcrumb
    • Button
    • Carousel
    • Checkbox
    • Combobox
    • Command
    • Date Picker
    • Form
    • Input
    • Input OTP
    • Label
    • MenuBar
    • Modal
    • Popover
    • Progress
    • Radio Group
    • Segmented
    • Select
    • Separator
    • Sheet
    • Sidebar
    • Skeleton
    • Slider
    • Spinner
    • Steps
    • Switch
    • Tabs
    • Textarea
    • Toast
    • Tooltip
    • Typography
  1. Layout
  2. Layout Guide

Layout Guide

Create flexible layouts with PallasUI patterns

Pallas UI leverages Panda CSS patterns for creating flexible and responsive layouts. We've extended these patterns with a standard set of properties to provide consistent layout control across all components.

Core Layout Patterns

Pallas UI provides several layout patterns to help structure your UI:

  • Box - A basic container with no styling applied, useful for applying custom styles
  • Flex - A flexible container that can arrange items horizontally or vertically
  • Stack - A simplified flex container for stacking elements
  • HStack - A horizontal stack with items aligned in the center
  • VStack - A vertical stack with items aligned in the center
  • Grid - A CSS grid container for two-dimensional layouts
  • Shapes - Circle and Square components for creating simple geometric shapes
  • AspectRatio - A container that maintains a specific aspect ratio

Common Properties

All layout patterns in Pallas UI share these common properties:

PropCSS PropertyDescription
ppaddingPadding on all sides
pxpaddingInlineHorizontal padding (left and right)
pypaddingBlockVertical padding (top and bottom)
ptpaddingTopPadding top
prpaddingRightPadding right
pbpaddingBottomPadding bottom
plpaddingLeftPadding left
mmarginMargin on all sides
mxmarginInlineHorizontal margin (left and right)
mymarginBlockVertical margin (top and bottom)
mtmarginTopMargin top
mrmarginRightMargin right
mbmarginBottomMargin bottom
mlmarginLeftMargin left
wwidthElement width
minWminWidthMinimum width constraint
maxWmaxWidthMaximum width constraint
hheightElement height
minHminHeightMinimum height constraint
maxHmaxHeightMaximum height constraint
positionpositionCSS position value (static, relative, absolute, fixed, sticky)

Usage

Pallas UI's layout patterns can be imported from the JSX namespace:

import { Box, Flex, HStack, VStack, Grid, Circle, Square, AspectRatio } from '@styled-system/jsx'
 
function MyComponent() {
  return (
    <Box p={4} maxW="1200px" mx="auto">
      <VStack gap={4} minH="400px">
        <HStack gap={2} w="full" justify="space-between">
          <Circle size="50px" bg="primary" />
          <Square size="50px" bg="secondary" />
        </HStack>
        
        <Grid columns={2} gap={4} w="full">
          <Box p={4} bg="gray.100" position="relative">
            <Box position="absolute" top={2} right={2}>
              ✨
            </Box>
            Grid item with padding and positioning
          </Box>
          <Box py={6} px={4} bg="gray.100" minH="100px">
            Grid item with vertical/horizontal padding
          </Box>
        </Grid>
 
        <Flex direction="row" wrap="wrap" gap={4} mt={8}>
          <Box flex="1" px={4} maxW="300px">
            Flexible item with max width
          </Box>
          <Box flex="1" px={4} maxW="300px">
            Another flexible item
          </Box>
        </Flex>
      </VStack>
    </Box>
  )
}

For detailed examples and all available properties, check the documentation for each specific layout pattern.

Built with ❤️ by the carbonteq team. The source code is available on GitHub.

© 2025 Pallas UI. All rights reserved.