---
title: "Section · Ark UI — StyleX Blocks"
description: "Titled content sections with description and body slots for settings pages."
url: "https://stylexblocks.com/components/ark-ui/section/"
agent:
  instructions: "Use this search API to find relevant components and blocks across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://stylexblocks.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Section

Titled content sections with description and body slots for settings pages.

- Behavior engine: Ark UI
- Also available for: [Base UI](https://stylexblocks.com/components/base-ui/section.md), [UI SDK](https://stylexblocks.com/components/ui-sdk/section.md)
- Category: Layout
- HTML page: https://stylexblocks.com/components/ark-ui/section/

## Install

Configure the project once (sets the behavior engine and import aliases):

```sh
npx stylexblocks init
```

Then add the item as source you own:

```sh
npx stylexblocks add section
```

Equivalent: `npx shadcn add @stylexblocks/section`. Registry item JSON: https://stylexblocks.com/r/ark-ui/section.json

## Usage

```tsx
import { Section, sectionAnnotated } from "#components/ui/ark-ui/section.tsx";

export function Example() {
  return (
    // composition per part via asChild; for the two-column annotated layout
    // compose the exported styles:
    // <Section.Root style={sectionAnnotated.root}> +
    // <Section.Header style={sectionAnnotated.header}>
    <Section.Root>
      <Section.Header>
        <Section.Title>Members</Section.Title>
        <Section.Description>Invite and manage your team.</Section.Description>
      </Section.Header>
      <Section.Body>…</Section.Body>
    </Section.Root>
  );
}
```

## Source

`components/ui/ark-ui/section.tsx`

```tsx
import * as stylex from "@stylexjs/stylex";
import { createSlotRecipeContext } from "#lib/ark-ui/create-slot-recipe-context.tsx";
import { defineSlotRecipe } from "#lib/recipe-props.ts";
import { fontSizes } from '@stylexblocks/ui/tokens/font-sizes.stylex.ts'
import { fontWeights } from '@stylexblocks/ui/tokens/font-weights.stylex.ts'
import { semanticColors } from '@stylexblocks/ui/semantic-tokens/colors.stylex.ts'
import { spacing } from '@stylexblocks/ui/tokens/spacing.stylex.ts'

const sectionRoot = stylex.create({
  base: {
    display: 'flex',
    flexDirection: 'column',
  },
})

const sectionRootVariants = stylex.create({
  annotated: {
    marginTop: spacing._4,
  },
})

const sectionHeader = stylex.create({
  base: {
    flexShrink: 0,
    marginBottom: spacing._4,
  },
})

const sectionHeaderVariants = stylex.create({
  annotated: {},
})

const sectionTitle = stylex.create({
  base: {
    fontWeight: fontWeights.medium,
    lineHeight: '110%',
    letterSpacing: '-1%',
    marginBottom: spacing._1,
  },
})

const sectionDescription = stylex.create({
  base: {
    color: semanticColors.fgMuted,
    fontSize: fontSizes.md,
  },
})

const sectionBody = stylex.create({
  base: {
    flex: 1,
    minWidth: 0,
  },
})

export type SectionVariant = keyof typeof sectionRootVariants

// defineSlotRecipe validates the shape at compile time. The generated
// `annotated` maps have no plain counterpart to default to, so the section
// exposes no variant axis; the annotated layout styles are exported below.
const sectionSlotRecipe = defineSlotRecipe({
  slots: {
    root: { styles: sectionRoot },
    header: { styles: sectionHeader },
    title: { styles: sectionTitle },
    description: { styles: sectionDescription },
    body: { styles: sectionBody },
  },
  defaultVariants: {},
});

/**
 * Section — recipe and component colocated in one file; each part composes
 * via `asChild`. For the two-column annotated layout, compose the exported
 * styles: `<Section.Root style={sectionAnnotated.root}>` +
 * `<Section.Header style={sectionAnnotated.header}>`.
 */
const { withProvider, withContext } =
  createSlotRecipeContext(sectionSlotRecipe);

export const sectionAnnotated = {
  root: sectionRootVariants.annotated,
  header: sectionHeaderVariants.annotated,
};

export const Section = {
  Root: withProvider("section", "root", "SectionRoot"),
  Header: withContext("header", "header", "SectionHeader"),
  Title: withContext("h2", "title", "SectionTitle"),
  Description: withContext("p", "description", "SectionDescription"),
  Body: withContext("div", "body", "SectionBody"),
};
```
