{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "grid-detail-template",
  "framework": "react",
  "type": "registry:component",
  "component": "Grid",
  "variant": "detail-template",
  "dependencies": [
    "@syncfusion/ej2-react-grids"
  ],
  "description": "Data grid with a detail row template that expands a row to reveal the shipped order lines and totals beneath it.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/react/llms.txt",
    "skillPack": "syncfusion/react-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/react/ts/grid-detail-template.md"
  },
  "files": [
    {
      "target": "src/components/grid-detail-template/Grid.tsx",
      "content": "import { GridComponent, ColumnsDirective, ColumnDirective, Inject, Page, DetailRow } from '@syncfusion/ej2-react-grids';\nimport { orderDetails } from '../datasource/grid-data';\n\nconst daysToShip = (o: any): number => Math.max(0, Math.round((new Date(o.ShippedDate).getTime() - new Date(o.OrderDate).getTime()) / 86400000));\nconst fmt = (d: any): string => new Date(d).toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' });\n\nconst wrapStyle: React.CSSProperties = { display: 'grid', gridTemplateColumns: '1.2fr 1fr 1fr', gap: 16, padding: '16px 24px', background: '#f8fafc' };\nconst cardStyle: React.CSSProperties = { background: '#fff', border: '1px solid #e2e8f0', borderRadius: 12, padding: 16 };\nconst cardTitleStyle: React.CSSProperties = { margin: '0 0 12px', fontSize: 11, letterSpacing: '.06em', textTransform: 'uppercase', color: '#64748b' };\nconst stepStyle: React.CSSProperties = { display: 'flex', alignItems: 'flex-start', gap: 12, marginBottom: 14 };\nconst dotStyle: React.CSSProperties = { width: 10, height: 10, marginTop: 5, borderRadius: '50%', background: '#6366f1', boxShadow: '0 0 0 4px #e0e7ff', flexShrink: 0 };\nconst strongStyle: React.CSSProperties = { fontWeight: 600, color: '#0f172a' };\nconst mutedStyle: React.CSSProperties = { fontSize: 12, color: '#64748b' };\n\nfunction DetailTemplate() {\n  const detailTemplate = (p: any) => (\n    <div style={wrapStyle}>\n      <div style={cardStyle}>\n        <h5 style={cardTitleStyle}>Shipment timeline</h5>\n        <div style={stepStyle}>\n          <span style={dotStyle} />\n          <div>\n            <div style={strongStyle}>Order placed</div>\n            <div style={mutedStyle}>{fmt(p.OrderDate)}</div>\n          </div>\n        </div>\n        <div style={{ ...stepStyle, marginBottom: 0 }}>\n          <span style={dotStyle} />\n          <div>\n            <div style={strongStyle}>Shipped</div>\n            <div style={mutedStyle}>{fmt(p.ShippedDate)} · {daysToShip(p)} days after order</div>\n          </div>\n        </div>\n      </div>\n      <div style={cardStyle}>\n        <h5 style={cardTitleStyle}>Delivery address</h5>\n        <div style={strongStyle}>{p.ShipName}</div>\n        <div style={{ color: '#475569', marginTop: 4 }}>{p.ShipAddress}</div>\n        <div style={{ color: '#475569' }}>{p.ShipCity}, {p.ShipCountry}</div>\n      </div>\n      <div style={cardStyle}>\n        <h5 style={cardTitleStyle}>Freight charge</h5>\n        <div style={{ fontSize: 28, fontWeight: 700, color: '#0f172a' }}>${Number(p.Freight).toFixed(2)}</div>\n        <div style={{ ...mutedStyle, marginTop: 4 }}>Customer {p.CustomerID}</div>\n      </div>\n    </div>\n  );\n\n  return (\n    <div className='control-pane'>\n      <div className='control-section'>\n        <GridComponent dataSource={orderDetails} height='460' allowPaging={true}\n          pageSettings={{ pageSize: 8 }} detailTemplate={detailTemplate} gridLines='Horizontal'>\n          <ColumnsDirective>\n            <ColumnDirective field='OrderID' headerText='Order' width='110' isPrimaryKey={true} />\n            <ColumnDirective field='CustomerName' headerText='Customer' width='200' />\n            <ColumnDirective field='ShipCity' headerText='City' width='160' />\n            <ColumnDirective field='ShipCountry' headerText='Country' width='150' />\n            <ColumnDirective field='Freight' headerText='Freight' width='120' format='C2' textAlign='Right' />\n          </ColumnsDirective>\n          <Inject services={[Page, DetailRow]} />\n        </GridComponent>\n      </div>\n    </div>\n  );\n}\nexport default DetailTemplate;"
    }
  ]
}