# Column

Column holds part of a page at a readable width, centred in the space around it.

Job: Arrange. Place things on the page. This is your job, not the person's. A leaf: it does one thing.

```tsx
<Column size="2">
  …
</Column>
```

## Overview

Use a Column for a page's main content, such as a form, an article or a settings page. It is as wide as its pane until the pane is wider than its `size`, then it stops growing and sits in the middle. Inside it, it works like a `Stack`.

`size` sets the widest it gets: 560, 704, 896 or 1152px for 1 to 4. Size 2 is a comfortable reading width.

A Column is its own safe area. A page title, its text and the boxes below it all start on the column's edge, wherever the column sits in the pane.

## Not supported

- `maxWidth` — The width is a step on a scale, so columns across an app line up. Use `size`.

## Examples

```tsx
import {
  Button,
  Column,
  Field,
  FieldLabel,
  Heading,
  Stack,
  TextField,
} from "@kushagradhawan/kookie-ui-react";

// A profile form in a narrow column. However wide the pane, the form keeps its width and
// sits in the middle, and the heading, labels and fields share the column's edge.
export default function Example() {
  return (
    <Column size="1">
      <Stack gap="5">
        <Heading size="6">Profile</Heading>
        <Field>
          <FieldLabel>Name</FieldLabel>
          <TextField defaultValue="Asha Rao" />
        </Field>
        <Field>
          <FieldLabel>Email</FieldLabel>
          <TextField type="email" defaultValue="asha@example.com" />
        </Field>
        <Button emphasis="loud">Save</Button>
      </Stack>
    </Column>
  );
}
```

### Side by side

Put columns in a `Flex` to lay out a page in columns. They share the row evenly, and each one keeps its own edge. They don't stack on a narrow screen yet.

```tsx
import { Column, Flex, Heading, Stack, Text } from "@kushagradhawan/kookie-ui-react";

// Two columns in a row share it evenly, and each is its own region with its own edge.
export default function Example() {
  return (
    <Flex gap="6">
      <Column size="1">
        <Stack gap="3">
          <Heading size="5">Shipping</Heading>
          <Text emphasis="medium">Asha Rao, 12 Park Street, Kolkata 700016</Text>
        </Stack>
      </Column>
      <Column size="1">
        <Stack gap="3">
          <Heading size="5">Payment</Heading>
          <Text emphasis="medium">Visa ending 4242, billed on the 1st</Text>
        </Stack>
      </Column>
    </Flex>
  );
}
```

## 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 |
| --- | --- | --- |
| `backdrop?` | `boolean` | Marks an area where the components sit over other content, such as a toolbar over a canvas or a panel over an image. |
| `container?` | `boolean` | Make this Box measurable. |
| `render?` | `RenderElement` | Renders the box as a different element, so you don't add a wrapper. |
| `size?` | `"1" \| "2" \| "3" \| "4"` | The column's maximum width: 560, 704, 896 or 1152px for sizes 1 to 4. |

It also takes every prop of a `<div>`.
