Utility layout for stacking elements with consistent spacing.
Copy the full block below to use this component with its imports.
--- import { Auto-Stack(Vertical) } from 'astro-component-kit'; --- <VerticalStack gap="1.5rem">Content</VerticalStack>
If you are not using the npm package, create a new file src/components/lib/Auto-Stack(Vertical).astro and paste the following code:
src/components/lib/Auto-Stack(Vertical).astro
--- interface Props { gap?: string; } const { gap = '1.5rem' } = Astro.props; --- <div class="v-stack" style={`--gap: ${gap}`}><slot /></div> <style> .v-stack { display: flex; flex-direction: column; gap: var(--gap); } </style>
Auto-Stack(Vertical).astro