Space
Set spacing between inline or block elements with flexible alignment and wrapping.
When to Use
- To add consistent spacing between a series of components
- To align elements horizontally or vertically with flexible gap control
- To group form controls with
Space.Compactfor connected styling
Import
Examples
Basic Horizontal
The default layout arranges children horizontally with middle spacing.
Vertical
Set direction="vertical" for a vertical stack.
Sizes
Choose from preset sizes or provide a custom pixel value.
Wrap Mode
Enable wrapping for items that may overflow the container.
Compact
Space.Compact groups controls with connected borders, similar to input groups.
API
SpaceProps
direction—"horizontal" | "vertical"— Layout direction (default:"horizontal")size—"small" | "middle" | "large" | number— Gap between items (default:"middle")align—"start" | "end" | "center" | "baseline"— Cross-axis alignmentwrap—boolean— Whether to wrap overflowing items (default:false)split—ReactNode— Separator element between itemsclassName—string— Custom CSS class
Space.Compact Props
direction—"horizontal" | "vertical"— Layout direction (default:"horizontal")size—"small" | "middle" | "large"— Size for all children (default:"middle")block—boolean— Full-width compact group (default:false)