# Grouped List

GroupedList is the body of a settings screen: it fills the region, scrolls, and holds groups of rows.

Job: Arrange. Place things on the page. This is your job, not the person's. A pattern: it owns the decisions this job needs.

```tsx
<GroupedList>
  <RowGroup label="Display">
    <Row render={<label />} trailing={<Switch />}>Increase contrast</Row>
  </RowGroup>
</GroupedList>
```

## Overview

Use a GroupedList when a screen is groups of rows, such as settings. Put it where the region's scroll area goes: after the toolbar in a dialog, sheet or popover, and in place of `ShellScroll` in a Shell pane. It is that scroll area, so the toolbars float over it as usual.

Inside it, each `RowGroup`'s box is a shade off the region, so the groups read without borders. Every control goes in a row: a switch, a select, a text field. A screen is groups of rows or loose fields, never both.

## Not supported

- A background — The region's own colour shows. Each group's box is what stands out.

## Example

```tsx
"use client";

import { GroupedList, Row, RowGroup, Stack, Switch } from "@kushagradhawan/kookie-ui-react";

export default function Example() {
  return (
    <GroupedList aria-label="Settings" style={{ maxWidth: "26rem", blockSize: "22rem" }}>
      <Stack gap="6">
        <RowGroup label="Display">
          <Row render={<label />} trailing={<Switch />}>
            Increase contrast
          </Row>
          <Row render={<label />} trailing={<Switch defaultChecked />}>
            Reduce transparency
          </Row>
        </RowGroup>
        <RowGroup label="Editor" note="Applies to every document.">
          <Row render={<label />} trailing={<Switch defaultChecked />}>
            Show word count
          </Row>
          <Row render={<label />} trailing={<Switch />}>
            Wrap long lines
          </Row>
        </RowGroup>
      </Stack>
    </GroupedList>
  );
}
```

## Props

Generated from the types. It lists what this component DECLARES: a prop that arrives from a shared type or from the platform is real and is not repeated here.

| Prop | Type | What it does |
| --- | --- | --- |
| `aria-label?` | `string` | The accessible name of the list, when nothing on screen names it. |
| `aria-labelledby?` | `string` | The id of an element that names the list, usually the region's title. |
| `children?` | `React.ReactNode` | The groups, usually `RowGroup`s, and a title above them if the region has one. |
| `className?` | `string` | Your classes, appended to the ones this component resolves rather than replacing them.  |
| `fade?` | `boolean` | Fades the content at each edge that has more content beyond it. |
| `style?` | `React.CSSProperties` | Inline styles, merged last, so your value wins over anything the component resolved.  |
