Veil UI
Components

Section

Groups a heading, description, actions and content into a page section.

Installation

$ npx veil-ui@latest add section

Usage

import {
  Section,
  SectionActions,
  SectionContent,
  SectionDescription,
  SectionHeader,
  SectionTitle,
} from "@/components/ui/section";

<Section>
  <SectionHeader>
    <div className="grid gap-1">
      <SectionTitle>Team members</SectionTitle>
      <SectionDescription>People with access to this workspace.</SectionDescription>
    </div>
    <SectionActions>
      <Button size="sm">Invite</Button>
    </SectionActions>
  </SectionHeader>
  <SectionContent>...</SectionContent>
</Section>;

Examples

Basic

Usage

Track requests, errors and latency across every project.

Charts and tables go here.

With actions

Team members

People with access to this workspace.

3 members · 1 pending invitation

Separated

General

Workspace name, slug and region.

Danger zone

Deleting a workspace cannot be undone.

Add border-t pt-8 to separate stacked sections, as in the last example.

API reference

Section

PropTypeDefaultDescription
...propsReact.ComponentProps<"section">—All native section attributes.

Subcomponents

  • SectionHeader — flex row that keeps the title and actions apart and wraps.
  • SectionTitle — h2 heading; pass a different element via asChild-style composition if your outline requires it.
  • SectionDescription — muted supporting text.
  • SectionActions — row of buttons aligned with the header.
  • SectionContent — grid container for the section body.

Accessibility

  • Section renders a real <section> landmark region.
  • SectionTitle renders an <h2>; keep the page's heading hierarchy intact by styling or swapping the element when the section nests deeper.
  • Actions are real buttons supplied by you, not clickable wrappers.

Vue and plain HTML

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

<script setup lang="ts">
import { computed } from "vue";

import { cn } from "@/lib/utils";

const props = defineProps<{ class?: string }>();

const classes = computed(() => cn("grid gap-4", props.class));
</script>

<template>
  <section data-slot="section" :class="classes">
    <slot />
  </section>
</template>

On this page