# \<s-table\> causes \>0.1 layout shift (CLS) on server-rendered pages

**URL:** <https://community.shopify.dev/t/s-table-causes-0-1-layout-shift-cls-on-server-rendered-pages/39289>\
**Category:** Polaris\
**Created:** [November 1, 2026, 1:21am UTC](https://community.shopify.dev/t/s-table-causes-0-1-layout-shift-cls-on-server-rendered-pages/39289 "2026-11-01T01:21:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Ryan](https://avatars.discourse-cdn.com/v4/letter/_/df705f/32.png) [@\_Ryan](https://community.shopify.dev/u/_Ryan)\
**Post date:** [November 1, 2026, 1:21am UTC](https://community.shopify.dev/t/s-table-causes-0-1-layout-shift-cls-on-server-rendered-pages/39289/1 "2026-11-01T01:21:44Z")

</div>

Since moving our embedded app from Polaris React’s DataTable to the `<s-table>` web component (polaris-2.js), our CLS in Shopify’s Web Vitals has risen. Some pages with a table now score 0.13–0.42 on a cold load, above the 0.1 Built for Shopify threshold.

**What happens:** we server-render the table markup. Once polaris-2.js defines `<s-table>`, the table lays itself out in several passes: the filters and header appear, the pagination bar moves from the top of the table to the bottom, and the column widths are recalculated. If the browser paints between passes, every later pass counts as a layout shift. Whether that happens varies from load to load, so some loads score 0 and others score well over 0.1. Long product titles of uneven length and two-line cells make it worse, because the column-width passes are bigger. React isn’t involved: all of the shifts happen before our app hydrates, and the repro below has no React at all.

**Repro (polaris-2.js only, no app or framework):** [s-table layout shift repro](https://soft-morning-a3fa.consignify-shop.workers.dev/s-table-cls-minimal)

Open it in Chrome with DevTools open and do a few hard reloads. Each shift is logged to the console as `layout-shift <value> total CLS <total>`, or just check the “Performance” tab. In Chrome 56.0.8078.79 we see totals of 0.03 - 0.3 per load, with the 75% above 0.1.

The page is just a layout-shift observer, the polaris-2.js script tag, and a 25-row table:

```auto
<script src="https://cdn.shopify.com/shopifycloud/polaris-2.js"></script>
<s-section padding="none">
  <s-table paginate hasNextPage>
    <s-stack slot="filters" gap="small-300">…search field and filter buttons…</s-stack>
    <s-table-header-row>
      <s-table-header listSlot="primary">Product</s-table-header>
      <s-table-header listSlot="secondary">Status</s-table-header>
      <s-table-header format="numeric">In stock</s-table-header>
      …
    </s-table-header-row>
    <s-table-body>
      <s-table-row clickDelegate="product-0-link">
        <s-table-cell>
          <s-grid gridTemplateColumns="auto 1fr" gap="small-200" alignItems="center">
            <s-thumbnail size="small-200" alt=""></s-thumbnail>
            <s-stack gap="none">
              <s-link id="product-0-link" href="#">Vintage Levi's 501 denim trucker jacket, medium wash, size M</s-link>
              <s-text color="subdued">Size M / Indigo</s-text>
            </s-stack>
          </s-grid>
        </s-table-cell>
        <s-table-cell><s-badge tone="success">Active</s-badge></s-table-cell>
        …
      </s-table-row>
      …24 more rows…
    </s-table-body>
  </s-table>
</s-section>

```

**Expected:** `<s-table>` doesn’t move content it has already painted, for example by not showing its rows until its table layout is in place.

**Our workaround for now:** we render a wrapper div with `visibility: hidden` from the server. A small inline script shows it once a `ResizeObserver` reports no size change for 100 ms. That brings our cold-load CLS to 0, but we’d rather not keep it, since it delays showing the table and relies on guessing when the layout has settled.

---

<div class="post-metadata">

**Author:** ![Tom\_Hooker](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/tom_hooker/32/732_2.png) [@Tom\_Hooker](https://community.shopify.dev/u/Tom_Hooker)\
**Post date:** [November 1, 2026, 8:42am UTC](https://community.shopify.dev/t/s-table-causes-0-1-layout-shift-cls-on-server-rendered-pages/39289/2 "2026-11-01T08:42:00Z")

</div>

Until there’s a fix in polaris-2.js, one thing that may help is reserving the table’s final space up front: give the table container a min-height based on your page size and set fixed column widths on the server-rendered markup so the column-width passes have less to move. You could also hide the table with visibility: hidden until the s-table element is defined (customElements.whenDefined(‘s-table’)) and then reveal it, which avoids layout shifts because the space is already reserved. It’s worth measuring both in your repro to see which brings cold-load CLS under 0.1.

---

<div class="post-metadata">

**Author:** ![\_Ryan](https://avatars.discourse-cdn.com/v4/letter/_/df705f/32.png) [@\_Ryan](https://community.shopify.dev/u/_Ryan)\
**Post date:** [November 1, 2026, 9:21am UTC](https://community.shopify.dev/t/s-table-causes-0-1-layout-shift-cls-on-server-rendered-pages/39289/3 "2026-11-01T09:21:47Z")

</div>

Thanks, Tom. Yes, my workaround at the moment is to hide the table until it stops resizing, measured with a pre-hydration resize observer.
