Skip to content

GkStack

Layout primitive: display: flex with direction, gap, alignment, and optional wrap.

When to use

Use as the default primitive for spacing and alignment instead of writing ad-hoc flex wrappers in app pages.

Live demo

OneTwoThree

API

Props

PropTypeDefaultDescription
tagstring'div'Root element
direction'row' | 'column''column'Flex direction
gap164Spacing token step
align'start' | 'center' | 'end' | 'stretch''stretch'align-items
justify'start' | 'center' | 'end' | 'space-between''start'justify-content
wrapbooleanfalseflex-wrap

Slots

SlotDescription
defaultChildren

Examples

Basic

vue
<script setup lang="ts">
import { GkStack } from 'god-kit/vue'
</script>

<template>
  <GkStack direction="column" :gap="3">
    <span>A</span>
    <span>B</span>
  </GkStack>
</template>

Advanced

vue
<GkStack direction="row" :gap="2" align="center" justify="space-between" wrap>
  <span>Filters</span>
  <span>Actions</span>
</GkStack>

Edge case

vue
<GkStack tag="ul" direction="column" :gap="1">
  <li>Accessible list item 1</li>
  <li>Accessible list item 2</li>
</GkStack>

Accessibility notes

  • Pick semantic tag values when stack wrappers represent lists, nav, or landmark groupings.
  • Preserve source order; visual flex arrangement should not conflict with reading order.

Released under the MIT License.