# grid-row-template

> Data grid with a row template that renders a full order card per row with customer avatar, ship-to details, and status chip.

**Framework:** react  **Component:** Grid  **Variant:** row-template

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/react/js/grid-row-template.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-react-grids @syncfusion/ej2-react-buttons
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/grid-row-template/Grid.jsx

```jsx
import { GridComponent, ColumnsDirective, ColumnDirective } from '@syncfusion/ej2-react-grids';
import { ChipListComponent } from '@syncfusion/ej2-react-buttons';
import { orderDetails } from '../datasource/grid-data';

const palette = ['#6366f1', '#0ea5e9', '#10b981', '#f59e0b', '#ec4899', '#8b5cf6'];
const colorFor = (text) => palette[[...text].reduce((sum, ch) => sum + ch.charCodeAt(0), 0) % palette.length];
const initials = (name) => name.trim().split(/\s+/).map((p) => p[0]).slice(0, 2).join('').toUpperCase();
const daysToShip = (o) => Math.max(0, Math.round((new Date(o.ShippedDate) - new Date(o.OrderDate)) / 86400000));
const statusOf = (days) => (days <= 5 ? 'Fast' : days <= 10 ? 'On time' : 'Delayed');

const cellStyle = { padding: 0, borderBottom: '1px solid #e0e0e0' };
const containerStyle = { display: 'flex', alignItems: 'flex-start', gap: 48, padding: '28px 40px' };
const imageStyle = { width: 110, height: 110, borderRadius: '50%', color: '#fff', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', flexShrink: 0 };
const lineStyle = { marginBottom: 14, fontSize: 17, lineHeight: 1.5, color: '#333', textAlign: 'left' };

function RowTemplate() {
  function gridTemplate(props) {
    const name = props.CustomerName.trim();
    const days = daysToShip(props);
    return (
      <tr>
        <td className='e-order-cell' style={cellStyle}>
          <div style={containerStyle}>
            <div style={{ ...imageStyle, background: colorFor(props.CustomerID) }}>
              <span style={{ fontSize: 32, fontWeight: 700, lineHeight: 1 }}>{initials(name)}</span>
              <span style={{ fontSize: 12, opacity: 0.9, marginTop: 6 }}>#{props.OrderID}</span>
            </div>
            <div style={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}>
              <div style={lineStyle}>
                <span style={{ fontWeight: 700, marginRight: 10 }}>{name}</span>
                <span style={{ fontWeight: 300 }}>({props.CustomerID})</span>
              </div>
              <div style={lineStyle}>{props.ShipName}, {props.ShipAddress}</div>
              <div style={lineStyle}>
                <ChipListComponent chips={[props.ShipCity, props.ShipCountry, `${statusOf(days)} · ${days}d`]} cssClass='e-outline' />
              </div>
              <div style={{ ...lineStyle, marginTop: 4, marginBottom: 0 }}>
                <span style={{ fontWeight: 300, fontSize: 18 }}>Freight</span>
                <span style={{ fontSize: 32, fontWeight: 500, marginLeft: 6 }}>${Number(props.Freight).toFixed(2)}</span>
              </div>
            </div>
          </div>
        </td>
      </tr>
    );
  }

  return (
    <div className='control-pane'>
      <div className='control-section'>
        <GridComponent dataSource={orderDetails} rowTemplate={gridTemplate} width='auto' height='460' gridLines='Horizontal'>
          <ColumnsDirective>
            <ColumnDirective headerText='ORDER LIST' textAlign='Center' field='CustomerName' customAttributes={{ class: 'e-order-cell' }} />
          </ColumnsDirective>
        </GridComponent>
      </div>
    </div>
  );
}
export default RowTemplate;
```
