# CellNode

<!-- schema:start — tự sinh từ cell.schema.ts, không sửa tay -->

Một ô của grid, chứa node con tùy ý. Chỉ được đặt trực tiếp trong grid.

## Resolved name

`cell`

## Configurable props

### Props

| Prop | Giá trị | Responsive | Mô tả |
| --- | --- | --- | --- |
| `hidden` | `true · false` | có | Ẩn node ở breakpoint này |
| `colSpan` | `số nguyên 1..24` | có | Số cột mà ô chiếm |

### `sx`

| Key | Giá trị | Breakpoint |
| --- | --- | --- |
| `height` | `px · 'N%' · 'auto'` | mọi breakpoint |
| `marginTop` | `px · 'auto'` | mọi breakpoint |
| `marginRight` | `px · 'auto'` | mọi breakpoint |
| `marginBottom` | `px · 'auto'` | mọi breakpoint |
| `marginLeft` | `px · 'auto'` | mọi breakpoint |
| `paddingTop` | `px` | mọi breakpoint |
| `paddingRight` | `px` | mọi breakpoint |
| `paddingBottom` | `px` | mọi breakpoint |
| `paddingLeft` | `px` | mọi breakpoint |
| `borderStyle` | `'solid' · 'dashed' · 'dotted'` | mọi breakpoint |
| `borderTopWidth` | `px` | mọi breakpoint |
| `borderRightWidth` | `px` | mọi breakpoint |
| `borderBottomWidth` | `px` | mọi breakpoint |
| `borderLeftWidth` | `px` | mọi breakpoint |
| `borderColor` | `color` | mọi breakpoint |
| `borderTopLeftRadius` | `px 0..9999` | mọi breakpoint |
| `borderTopRightRadius` | `px 0..9999` | mọi breakpoint |
| `borderBottomRightRadius` | `px 0..9999` | mọi breakpoint |
| `borderBottomLeftRadius` | `px 0..9999` | mọi breakpoint |
| `backgroundColor` | `color` | mọi breakpoint |
| `backgroundImage` | `url(https://…)` | mọi breakpoint |
| `backgroundSize` | `'cover' · 'contain' · 'auto'` | mọi breakpoint |
| `backgroundPosition` | `'left top' · 'top' · 'right top' · 'left' · 'center' · 'right' · 'left bottom' · 'bottom' · 'right bottom'` | mọi breakpoint |
| `backgroundRepeat` | `'no-repeat' · 'repeat-x' · 'repeat-y' · 'repeat'` | mọi breakpoint |
| `backgroundAttachment` | `'scroll' · 'fixed' · 'local'` | mọi breakpoint |
| `order` | `px` | mọi breakpoint |

`color` = `var(--color-{primary\|secondary\|red\|orange\|yellow\|green\|blue\|violet\|neutral}-{100..800\|contrast}) · var(--color-background-{subtle\|default\|emphasis}) · var(--color-border-default) · var(--color-surface-default) · var(--color-common-{black\|white}) · #rgb · #rrggbb`

## Rules

- **Nội dung**: nhận node con bất kỳ.
- **Cha hợp lệ**: `grid`.

<!-- schema:end -->

## Usage

```tsx
import { GridNode, CellNode, ParagraphNode } from '@janbox/storefront-builder';

// Cell mặc định (1 cột)
<GridNode cols={3}>
  <CellNode><ParagraphNode>Content A</ParagraphNode></CellNode>
  <CellNode><ParagraphNode>Content B</ParagraphNode></CellNode>
  <CellNode><ParagraphNode>Content C</ParagraphNode></CellNode>
</GridNode>

// colSpan: cell chiếm 2/3 cột, cell còn lại chiếm 1/3
<GridNode cols={3}>
  <CellNode colSpan={2}><ParagraphNode>Wide content</ParagraphNode></CellNode>
  <CellNode colSpan={1}><ParagraphNode>Narrow content</ParagraphNode></CellNode>
</GridNode>

// colSpan responsive: full-width mobile, 2 cột trên desktop
<GridNode cols={1} md={{ cols: 3 }}>
  <CellNode colSpan={1} md={{ colSpan: 2 }}>
    <ParagraphNode>Wide on desktop</ParagraphNode>
  </CellNode>
  <CellNode colSpan={1}>
    <ParagraphNode>Normal</ParagraphNode>
  </CellNode>
</GridNode>

// sx responsive
<CellNode
  colSpan={1}
  sx={{
    paddingTop: 12,
    paddingBottom: 12,
    backgroundColor: '#fff',
    md: {
      paddingTop: 24,
      paddingBottom: 24,
    },
  }}
>
  ...
</CellNode>
```

## Related nodes

- [`GridNode`](../grid/README.md) — parent bắt buộc của `CellNode`
