# How to Avoid Content Flash when using the CMS Filter Attribute?

**URL:** <https://forum.finsweet.com/t/how-to-avoid-content-flash-when-using-the-cms-filter-attribute/3442>\
**Category:** Attributes\
**Tags:** cmsfilter\
**Created:** [September 18, 2024, 8:17am UTC](https://forum.finsweet.com/t/how-to-avoid-content-flash-when-using-the-cms-filter-attribute/3442 "2024-09-18T08:17:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![juicydisorder](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/juicydisorder/32/6481_2.png) [@juicydisorder](https://forum.finsweet.com/u/juicydisorder)\
**Post date:** [September 18, 2024, 8:17am UTC](https://forum.finsweet.com/t/how-to-avoid-content-flash-when-using-the-cms-filter-attribute/3442/1 "2024-09-18T08:17:21Z")

</div>

Hey Finsweet Team and Community,

I’m currently using the CMS Filter Attributes, and I’m facing a small issue with content flashing on page load. When the page initially loads, for a brief moment, I can see the **Initial State Div** , the **Empty State Div** , and the **CMS List** all at once. However, I would like to ensure that only the **Initial State** is shown during the loading process, and the other elements are hidden until necessary.

Has anyone dealt with this issue before or know how to solve it? I’m looking for the best approach to avoid this flash and create a smoother user experience.

Any tips or advice would be greatly appreciated!

Thanks in advance! - Christian

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [September 18, 2024, 4:48pm UTC](https://forum.finsweet.com/t/how-to-avoid-content-flash-when-using-the-cms-filter-attribute/3442/2 "2024-09-18T16:48:27Z")

</div>

Hey @juicydisorder!

For the Empty element, you can wrap it with a div set to `display: none` without affecting the function of this.

For the list, I am finding it a bit tricky simply with Attributes so you can add the `hide` class and then remove it once the script is loaded with this snippet

```js
<script>
  window.fsAttributes = window.fsAttributes || [];
  window.fsAttributes.push([
    'cmsfilter',
    (filterInstances) => {
      console.log('cmsfilter Successfully loaded!');

      const [filterInstance] = filterInstances;
      const { listInstance } = filterInstance;
      listInstance.list.classList.remove('hide');
    },
  ]);
</script>

```

---

<div class="post-metadata">

**Author:** ![\_theclevernod](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/_theclevernod/32/1051_2.png) [@\_theclevernod](https://forum.finsweet.com/u/_theclevernod)\
**Post date:** [May 10, 2026, 3:50am UTC](https://forum.finsweet.com/t/how-to-avoid-content-flash-when-using-the-cms-filter-attribute/3442/3 "2026-05-10T03:50:37Z")

</div>

Curious what is the solution for v2?

---

<div class="post-metadata">

**Author:** ![jesse.muiruri](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/jesse.muiruri/32/6611_2.png) [@jesse.muiruri](https://forum.finsweet.com/u/jesse.muiruri)\
**Post date:** [May 10, 2026, 3:48pm UTC](https://forum.finsweet.com/t/how-to-avoid-content-flash-when-using-the-cms-filter-attribute/3442/4 "2026-05-10T15:48:47Z")

</div>

Hi @_theclevernod

Try this for v2

```auto
window.FinsweetAttributes ||= [];
window.FinsweetAttributes.push([
  'list',
  (listInstances) => {
    console.log('List Successfully loaded!');

    const [listInstance] = listInstances;
    listInstance.list.classList.remove('hide');
    console.log(listInstance);
  },
]);

```
