# Prevent Content Flash

## Setup

**Attribute**: `sf-noflash = true`

**Where**: [Form Container](/superform/essentials/form-container.md) or *any* element

The `sf-noflash` attribute is used to temporarily hide a form and/or form elements while Superform is initializing.&#x20;

This prevents elements from flashing or appearing prematurely before the form is fully interactive and styled, ensuring a smoother user experience. Can be used for any element (eg. errors in initial step)

{% hint style="warning" %}
Additional CSS required. Read below.
{% endhint %}

### Requirements

To make `sf-noflash` effective, include the following CSS in the `<head>` of your HTML document:

#### **CSS &#x20;**<mark style="background-color:red;">**required**</mark>&#x20;

```html
<style>
  [sf-noflash] {
    opacity: 0;
  }
</style>
```

This CSS rule sets  `opacity: 0` to any element with the `sf-noflash` attribute, effectively hiding it on initial load.

### **Can be used to solve:**

1. Steps (in a multistep form) flashing on initial load
2. Error elements flashing on initial load

**HTML Example**

{% code title="index.html" %}

```html
<!-- Form Container with No Flash Settings -->
<div sf="myForm" sf-noflash="true"">
    <form>
        <!-- Step 1 -->
        <div sf-step="step1">
            <!-- Content for Step 1 -->
            <button sf-goto="next">Next</button>
        </div>
        
        <!-- Step 2 -->
        <div sf-step="step2">
            <!-- Content for Step 2 -->
        </div>
    </form>
</div>
```

{% endcode %}

{% code title="styles.css" %}

```css
[sf-noflash] {
  opacity: 0;
}
```

{% endcode %}

**Webflow Example**

<figure><img src="/files/27OrHEDoF2zMncGzRKJz" alt=""><figcaption><p>Step 1: Add [sf-noflash] CSS rule in the &#x3C;head> of your page.</p></figcaption></figure>

<figure><img src="/files/Az08pknEGhWaHdp8Bxsu" alt=""><figcaption><p>Step 2: Add the <code>sf-noflash = true</code> directive.</p></figcaption></figure>

### 🚫 Without `sf-noflash`

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDGLtnaQr6bP3qHCWvX0r%2Fuploads%2FkI5RPdOCof2nGH6LNU7s%2Fnoflash%20-%20is-flashing.mp4?alt=media&token=c38c045a-284d-4ab1-a60e-ddcba96da8c1>" %}
Initial load without `sf-noflash`
{% endembed %}

### ✅ With `sf-noflash = true`

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDGLtnaQr6bP3qHCWvX0r%2Fuploads%2FEVEKt9ij0Q0nbSxN5tzC%2Fsf_noflash-true.mp4?alt=media&token=7c2f70ad-8aaf-4580-b662-216702119bcd>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://deltaclan.gitbook.io/superform/global-options/prevent-content-flash.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
