@ctablex/core
Advanced tools
Changelog
0.6.0 (2025-02-16)
Package Restructure
@ctablex/core
and moved core table concepts to @ctablex/table
.Context Changes
ContentContext
(replaces DataContext
, RowContext
, and other removed contexts).TableComponentsProvider
is replaced with TableElementsProvider
const elements: TableElements = {
table: <table data-testid="ctx-table" />,
thead: <thead data-testid="ctx-thead" />,
tbody: <tbody data-testid="ctx-tbody" />,
tfoot: <tfoot data-testid="ctx-tfoot" />,
tr: <tr data-testid="ctx-tr" />,
th: <th data-testid="ctx-th" />,
td: <td data-testid="ctx-td" />,
};
<TableElementsProvider value={elements}>
Prop Cleanup
*Props
props (tdProps
, thProps
, etc.).*El
props into the el
prop (e.g., tdEl
→ el
).<Column />
retains thEl
for header customization:
<Column el={<td />} thEl={<th />} />
Element Prop Behaviorel
now automatically injects children
. For empty content, pass null
explicitly:
<Column el={<td>{null}</td>} /> // Explicit empty content
(Ariakit-style [composition][ariakit composition])Accessor Default Change
accessor
is no longer null
. To replicate old behavior:
// Old:
<Column /> // (accessor=null)
// New:
<Column accessor={null} />
Omitting accessor
now passes content down without change.Type-Safe Accessors
Accessor paths are now validated with TypeScript. Typos trigger immediate feedback:
type Data = { name: { first: string; last: string } };
<Column<Data> accessor="name.first" /> // ✅ Valid
<Column<Data> accessor="name.las" /> // ❌ Error: "Did you mean 'name.last'?"
Changelog
0.4.0 (2022-10-16)
Now components can be customized with xEl prop instead of xProps. It helps for a better type check.
return <Row TrProps={{ className: "zebra" }} />;
// vs
return (
<Row
trEl={
<tr className="zebra">
<Children />
</tr>
}
/>
);
// or
const MyTr = withDefaultChildren("tr");
return <Row trEl={<MyTr className="zebra" />} />;
Changelog
0.3.0 (2020-12-20)