Veil UI
Components

VStack

A vertical Stack preset for form and content sections.

Installation

$ npx veil-ui@latest add vstack

Usage

import { VStack } from "@/components/ui/vstack";

<VStack gap="sm">
  <Input placeholder="Email" />
  <Input placeholder="Password" type="password" />
</VStack>;

Examples

Basic

First item
Second item
Third item

Form

Centered

Ada Lovelace

Engineer

API reference

VStack forwards every Stack prop except direction, which is fixed to column. Defaults: gap="md", align="stretch" and justify="start".

PropTypeDefaultDescription
gap"none" | "xs" | "sm" | "md" | "lg" | "xl""md"Space between children.
align"start" | "center" | "end" | "stretch" | "baseline""stretch"Cross-axis alignment.
justify"start" | "center" | "end" | "between" | "around""start"Main-axis distribution.
...propsReact.ComponentProps<"div">—All native div attributes.

Accessibility

  • Presentational flex wrapper; it adds no ARIA roles.
  • Install it together with stack, which holds the shared implementation.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add vstack --framework vue or switch the framework in components.json.

<script setup lang="ts">
import { Stack } from "@/components/ui/stack";

const props = withDefaults(
  defineProps<{
    gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl";
    align?: "start" | "center" | "end" | "stretch" | "baseline";
    justify?: "start" | "center" | "end" | "between" | "around";
    wrap?: boolean;
    class?: string;
  }>(),
  {
    gap: "md",
    align: "stretch",
    justify: "start",
    wrap: false,
  },
);
</script>

<template>
  <Stack
    data-slot="v-stack"
    direction="column"
    :gap="props.gap"
    :align="props.align"
    :justify="props.justify"
    :wrap="props.wrap"
    :class="props.class"
  >
    <slot />
  </Stack>
</template>

On this page