> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Notifications and states

## Article: Notifications and States

## Article Link: https://dev.wix.com/docs/wix-design-system/guidelines/interaction-behavior/notifications-and-states.md

## Article Content:

<!-- heading -->

# Notifications and States

<!-- end heading -->

A UI state is a representation of an app or system status at a given point in time.

Defining clear and helpful UI states lets users understand the current system status and feel in control (see the first of 10 Jakob Nielsen's usability heuristics: [visibility of system status](https://www.nngroup.com/articles/visibility-system-status/).


## Principles

A well designed UI state in any Wix product follows two main principles:

**1. Contextual**<br>
The status is communicated as soon as possible. When possible, a status indication is placed next to the "source" of the issue.

**2. Clear**<br>
The status messages are straightforward. When there's an issue, they offer a way to solve it.


---

## States

The following guidelines outline the best practices for design loading, success, warning, and error states at Wix:

**1. Loading**<br>
Users are informed that the system is in the process of loading data or performing tasks. Requires no user action.

**2. Success**<br>
Users are informed that the system has completed their task as intended. Typically requires no user action.

**3. Warning**<br>
Users are advised about possible unintended consequences of continuing with their task. Invites but doesn't require to take an action.

**4. Error**<br>
Users are blocked from continuing their task because of their error, product limitations, or system failure. Requires immediate user action.


---

## 1. Loading

Loading state notifies users that the system is currently loading data or performing tasks. It needs to show that the system isn't unresponsive, but instead it is working to complete the requested action.

It's our responsibility to design loading experience intentionally and make the best use of waiting time. Wix users' median internet speed varies [from 50 to 192 Mbps](https://www.speedtest.net/global-index).

As a base point, utilize the most fitting loading techniques like prefetching and caching data, pagination, or progressive disclosure to decrease waiting time. The UI should supplement these techniques by keeping users involved and preparing them for what's ahead.


### 1.1. Loading a page

When a page is initially loading, look for ways to keep users engaged. Use animated [skeleton](#/component/skeletongroup) shapes to mimic the basic page structure and [decrease the perceived waiting time](https://uxdesign.cc/what-you-should-know-about-skeleton-screens-a820c45a571a).


<!-- dodont -->
<!-- dodont image -->
![Skeleton shapes mimicing web page structure](https://wixmp-833713b177cebf373f611808.wixmp.com/images/1e238ed68046d93c88e50680a3909c31.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Use skeleton shapes to mimic the basic page structure.
<!-- end dodont content -->
<!-- end dodont -->


Reveal parts of page content as soon as they're loaded:

* Show page header and section titles first to let users orient themselves on the page.
* Show the main CTA immediately so some users can continue their journey without waiting for the whole page to finish loading.


<!-- dodont -->
<!-- dodont image -->
![Buttons and headings revealed before other loading content](https://wixmp-833713b177cebf373f611808.wixmp.com/images/c0001bdfc8b656a68027e7a0640c0ac0.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Reveal parts of the page content as soon as they are loaded.
<!-- end dodont content -->
<!-- end dodont -->


Avoid using spinning loaders with no additional content on the page during the initial page load. This can create an impression of being stuck and fails to provide helpful information to the user.


<!-- dodont -->
<!-- dodont image -->
![Loading animation in the center of an empty page](https://wixmp-833713b177cebf373f611808.wixmp.com/images/e9715075a9e5b9faae0b8dd1f2c86bc7.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Don't
Don't show loader animation without additional content on the page.
<!-- end dodont content -->
<!-- end dodont -->


### 1.2. Loading data in phases

When an app is loading additional data to the page (for example, more items in a table), use a [loader](#/component/loader) animation or skeleton shapes in the area where page content will display.


<!-- dodont -->
<!-- dodont image -->
![Loader animation at the center of additionally loading items](https://wixmp-833713b177cebf373f611808.wixmp.com/images/143f42cb17005fef779aa0febc094315.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Show the loader animation in the central area where the page content appears.
<!-- end dodont content -->
<!-- end dodont -->


Spinning loaders are only effective for processes which take less than a couple of seconds. If it takes a bit longer, add a line of text nearby to indicate what's loading (for example, "Loading more products...").

However, when loading takes more than 10 seconds, reconsider your loading strategy or contact the Wix Design System team to discuss alternatives.


### 1.3. Loading after submit action

When users' data is being submitted to the system (for example, after a click on a "Save" button), the UI needs to reassure users that their work was received and is being processed.

When designing such loading states, consider what's the expected [duration of loading](https://www.nngroup.com/articles/progress-indicators/):

* Short: 1 to 2 seconds
* Medium: 2 to 10 seconds
* Long: 10 seconds and more


When expected loading time is short, show the loader animation inside the submit button and disable its click actions. The button illustrates that the app is working and shows its status in context.


<!-- dodont -->
<!-- dodont image -->
![Loading state of a button](https://wixmp-833713b177cebf373f611808.wixmp.com/images/fcba41aa4eaa56dd97beba4e6d4514d6.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
When loading time is short (1 to 2 seconds), show a loader animation inside the submit button.
<!-- end dodont content -->
<!-- end dodont -->


Disabling page or modal actions during loading is an anti-pattern. It's not descriptive enough, it shifts the focus to the start of the page for keyboard users, and the button "disappears" for those using a screen reader.


<!-- dodont -->
<!-- dodont image -->
![Loading state of a disabled button](https://wixmp-833713b177cebf373f611808.wixmp.com/images/8d03bf01b0aab1ef6660a39058dc9419.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Don't
Don't disable the page or modal actions during loading.
<!-- end dodont content -->
<!-- end dodont -->


When the expected loading time is longer (2 to 10 seconds), illustrate that the system is busy by placing a [loader](#/component/loader) animation with short text description inside a full page [overlay](#/component/modal). It doesn't allow users to make changes on top of what's being saved, since it might be lost after the load is complete.

<!-- dodont -->
<!-- dodont image -->
![Loading animation with text caption over a page overlay](https://wixmp-833713b177cebf373f611808.wixmp.com/images/6852d725374b24b84d1be3f4d254de8e.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
When loading time is longer (2 to 10 seconds), show a loader animation inside a page overlay.
<!-- end dodont content -->
<!-- end dodont -->


For lengthy loading (10 seconds and more), show real progress when possible. Use percent or other units in a progress bar.

Tell users what the system is working on and [continuously update](https://www.nngroup.com/articles/progress-indicators/) the loading message, like "Saving your ad campaign..." or "Launching the first ad...".


<!-- dodont -->
<!-- dodont image -->
![Widget showing progress with text caption, animation, and quantitative progress](https://wixmp-833713b177cebf373f611808.wixmp.com/images/ba99cbf60da3f62d82aaaad9ed971b8f.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
For long loading, show real progress when possible.
<!-- end dodont content -->
<!-- end dodont -->


### 1.4. Loading background tasks

Background tasks don't block users from continuing their journey in the app, such as uploading files or syncing data.

Keeping users informed about the progress of a background task and managing their expectations is essential. Progress indicators also need to block as little surface as possible, allowing users to continue their work.

Depending on your product needs, consider adding other useful features. For example, you may want to inform users what happens if an app is closed, or add a collapse/expand loading widget.

See how the Wix Media Manager created a new UI widget that keeps users informed about the progress of uploading items.


<!-- dodont -->
<!-- dodont image -->
![Loading widget illustrating the task progress at the bottom of a page](https://wixmp-833713b177cebf373f611808.wixmp.com/images/9153e3ce9e08e4bce2fb45533e5eac3f.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
For background tasks, keep users informed about the progress and block as little surface as possible.
<!-- end dodont content -->
<!-- end dodont -->


---

## 2. Success

When an app or system is in a success state, it confirms that the user's task has been completed as intended. For example, after clicking on a "Save" button, show that "Changes were saved."

Confirming success creates a smooth experience for the users. It "[serves to reassure](https://pencilandpaper.io/articles/success-ux/)" that their tasks were handled and [builds their trust](https://www.nngroup.com/articles/visibility-system-status/).


### 2.1. Success after submit actions

When users need to click on a submit action to process their data (for example, "Save" in Business manager pages or modals), show a status toast immediately after the task is done.

Use the [status toast](#/component/statustoast) in "success" state and allow users to close it. Because success communication isn't critical to the user's flow, use notification timeout and set it to 7 seconds.

Success status toast is only one part of the UI that shows users that their progress is saved. Users are also looking for [updates in the page content](https://docs.google.com/presentation/d/1pjWbZ9vXlT9FFYbwJuD8N4j2TIqkxSUPeiOIbYlMZ0g/edit#slide=id.g139c70fc16e_0_49), such as viewing newly uploaded items or a change in a switch that was toggled on.


<!-- dodont -->
<!-- dodont image -->
![Success notification after a task is completed](https://wixmp-833713b177cebf373f611808.wixmp.com/images/26fe1952d0a4c438058f42dd4d3b9b46.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
When users submit their data, show a toast immediately after it is successfully processed.
<!-- end dodont content -->
<!-- end dodont -->


Don't disable or hide submit actions until users have made changes in the page or modal.

Notes about disabled CTAs:

* They can create additional cognitive load for users who wonder how they can enable the action.
* They can be difficult to read, since they don't have sufficient contrast.
* They are often skipped by screen reader users.

Instead, allow users to submit their progress at their own pace, even when they haven't changed anything. Show success or error feedback immediately. Learn more in [Disabled elements in the Business manager](https://docs.google.com/presentation/d/1lOPuTSqFFMLNT7Ahivjdw1eS0WgK9O3SbLXyC-Cz_EU/edit#slide=id.gbac6653262_0_725).


<!-- dodont -->
<!-- dodont image -->
![Page actions are disabled until user makes changes inside a page](https://wixmp-833713b177cebf373f611808.wixmp.com/images/42c4ef3de353ea6514cbbdcc0470e9a9.gif)
<!-- end dodont image -->
<!-- dodont content -->
#### Don't
Don't disable or hide submit actions until users have made changes in the page.
<!-- end dodont content -->
<!-- end dodont -->


<!-- dodont -->
<!-- dodont image -->
![Page actions are kept enabled at all times](https://wixmp-833713b177cebf373f611808.wixmp.com/images/1a7f53c428fef693f85ad6e558806f2b.gif)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Allow users to submit their data with no changes and show feedback immediately.
<!-- end dodont content -->
<!-- end dodont -->


Success messages should be short, clear, and specific. For example, "Contact was added" instead of "A new contact was successfully created on your site."

In the notification, add a button only if it's directly related to the completed task, like "Undo."

Don't add any buttons that promote other features or serve as gateways to other flows, for example, "Manage Settings" or "Go to Editor." Because success notifications disappear quickly, these buttons aren't discoverable. Data from Wix shows that one such button was clicked 79 times out of 9 thousand cases (that's a 0.8% click-through rate).

Instead, promote related features using [section helpers](#/component/sectionhelper) or [floating helpers](#/component/floatinghelper) inside the main page layout. They won't disappear after a timeout, ensuring better exposure and giving users the ability to dismiss them on their own time.


<!-- dodont -->
<!-- dodont image -->
![Success notification with a button inside](https://wixmp-833713b177cebf373f611808.wixmp.com/images/d6de95b62fec49f36be4787e32f5676e.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Don't
Don't add buttons that promote further actions inside a success notification.
<!-- end dodont content -->
<!-- end dodont -->


<!-- dodont -->
<!-- dodont image -->
![Success notification without any buttons inside](https://wixmp-833713b177cebf373f611808.wixmp.com/images/a4aeee03d0f10a8c85f863e19f401d34.gif)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Promote further actions using banners or floating helpers inside the main page layout.
<!-- end dodont content -->
<!-- end dodont -->


### 2.2. Success after autosave

When a page doesn't have a submit action and autosaves changes, display a success notification after the first change has been processed. Such a success message informs users that all their changes are being saved.

Be sure to display the notification one time and not for subsequent or similar actions.


<!-- dodont -->
<!-- dodont image -->
![Success notification informs about system autosave](https://wixmp-833713b177cebf373f611808.wixmp.com/images/f55e2226609536aa2b4e89d5c0134d11.gif)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
In pages with autosave, show a success notification once and immediately after the first change is saved.
<!-- end dodont content -->
<!-- end dodont -->


When changes affect the user's live site, autosaving them inside the Business manager is [highly discouraged](https://docs.google.com/presentation/d/1Co65UBT72DH0D50KMILA7Lri5QL13HIlSnPVKrchXEE/edit#slide=id.gb47c58c8f9_0_8). Process their changes after a submit action like "Save" instead.

<!-- dodont -->
<!-- dodont image -->
![Page without submit actions](https://wixmp-833713b177cebf373f611808.wixmp.com/images/422f15e4f779bfc86fa75b97c0585e71.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Don't
Don't autosave user changes when the actions affect their live site.
<!-- end dodont content -->
<!-- end dodont -->


Inside modals, use a success toast as well. It always overlays other items and sits 26px from the bottom of the screen, keeping the consistency with other locations where status toast is shown. It will timeout after 7 seconds, but users should still be able to close it. 


<!-- dodont -->
<!-- dodont image -->
![Success notification used inside a modal](https://wixmp-833713b177cebf373f611808.wixmp.com/images/cb4d5f6fc90401f5f5823bb0f5a5cc3d.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Inside modals, display success messages using a status toast component.
<!-- end dodont content -->
<!-- end dodont -->


However, autosave in long tasks, such as creating a logo or writing a blog post, shouldn't "[get a huge party](https://pencilandpaper.io/articles/success-ux/#things-to-consider-when-designing-success-ux-patterns)" each time changes are autosaved. Instead, show save status in the main page layout at all times.

In Wix composers, for example, there's a dedicated space for the save status in the [composer header](#/component/composerheader) component.


<!-- dodont -->
<!-- dodont image -->
![Showing task status in the main page layout](https://wixmp-833713b177cebf373f611808.wixmp.com/images/f04c6d3bb6fddc3fda582e7cbf492666.gif)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
For long tasks with autosave, always display the save status in the main page layout.
<!-- end dodont content -->
<!-- end dodont -->


### 2.3. Success in background tasks

When an app or system performs tasks in the background, expect some users to continue their work in other flows or pages. That's why it's important to keep showing success messages in the UI until users close them.

Wix Media Manager informs users that files were uploaded, even after closing the app. The status indicator inside the upload widget shows a successful upload until users close it.


<!-- dodont -->
<!-- dodont image -->
![Success state of a background task widget at the bottom of a page](https://wixmp-833713b177cebf373f611808.wixmp.com/images/ec9fa42ae91ecc8c9050ffc571c1fff0.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
For background tasks, leave success messages in the UI until users close them.
<!-- end dodont content -->
<!-- end dodont -->


If the background task is especially lengthy, such as connecting a new domain which may take up to a day, consider using different notification channels. For example, send an email once the task is done or place a green success [banner](#/component/sectionhelper) in the main page layout.


<!-- dodont -->
<!-- dodont image -->
![Success banner at the top of main page layout to inform about a successful background task](https://wixmp-833713b177cebf373f611808.wixmp.com/images/dceecbbb863de732e3d2393b26c99271.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
For lengthy background tasks, use success banners.
<!-- end dodont content -->
<!-- end dodont -->


---

## 3. Warning

A warning is a message that alerts users about a potential problem or unexpected results of their action, such as possible loss of data, upcoming expirations, or pending requests. It helps users avoid future interruptions and unintended consequences.

Warnings are different from error messages because they appear **before** a potential issue takes place. When users are unable to proceed without fixing the issue first, a warning becomes an error.


### 3.1. Application warning

An application level warning is a message that applies to the whole app or page. For example, it warns users of payment issues due to disconnected payment methods, meanwhile users can still continue to manage their settings.

Because such issues usually occur or start in the background, they need to be visible immediately after users arrive at the app. To give an app level warning, place a yellow [section helper](#/component/sectionhelper) right below the page header.

Include an action that assists users in resolving their issues and allow them to close the helper. If the warning is still relevant when the page is reloaded, show it again.


<!-- dodont -->
<!-- dodont image -->
![Warning banner placed below page header](https://wixmp-833713b177cebf373f611808.wixmp.com/images/c69cee80b81c5b475aa9f89c706f95c8.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Place an app level warning below the page header.
<!-- end dodont content -->
<!-- end dodont -->


Don't use [status toast](#/component/statustoast) to inform users about issues that have occurred or started prior to their arrival on the page. Instead, reserve notifications only for **immediate** feedback on recent user or system actions.


<!-- dodont -->
<!-- dodont image -->
![Notification used for app level warning](https://wixmp-833713b177cebf373f611808.wixmp.com/images/a73925da5b38ccd23ce02031fb20449a.gif)
<!-- end dodont image -->
<!-- dodont content -->
#### Don't
Don't use status toast for app level warnings.
<!-- end dodont content -->
<!-- end dodont -->


### 3.2. Section warning

Some warnings only apply to specific sections of a page or an app, for example, a single card.

Aim to place such a warning first in the section that it applies to. Add a [section helper](#/component/sectionhelper) in "warning" skin right below the page section heading, card header, or modal header.


<!-- dodont -->
<!-- dodont image -->
![Section warning placed at the start of section that it relates to](https://wixmp-833713b177cebf373f611808.wixmp.com/images/a3ff34edd1910850acbbaf65b098e004.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Place section warnings first in the related section.
<!-- end dodont content -->
<!-- end dodont -->


### 3.3. Inline warning

Warnings can also stem from individual data values in form inputs and controls, such as a number input or a date picker. In these cases, the data that users provide is valid, but they need to be aware of possible unexpected consequences.

Keep the warning close to its source by adding an inline [warning message below](#/component/formfield) the input or control. Reveal the inline warning message as soon as possible.


<!-- dodont -->
<!-- dodont image -->
![Warning at the bottom of an input](https://wixmp-833713b177cebf373f611808.wixmp.com/images/147e770992ce18f3da05aaaab0bf793a.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Add an inline warning message below the input or control.
<!-- end dodont content -->
<!-- end dodont -->


---

## 4. Error

An error state happens when users can't continue their work or their task hasn't been completed or saved. Errors usually occur because of technical issues, app limits, or invalid data entries.

Designing error states requires extra effort, because the interface not only needs to clearly communicate the problem, but also offer actionable steps to correct it. It needs to [answer user questions](https://wix-ux.com/when-life-gives-you-lemons-write-better-error-messages-46c5223e1a2f), such as:

* "What went wrong?"
* "What happened?"
* and, most importantly, "How can I fix it?"


### 4.1. Prevent errors by design

As stated in Jakob Nielsen's usability heuristic #5 [Error prevention](https://www.nngroup.com/articles/slips/), "Good error messages are important, but the best designs carefully prevent problems from occurring in the first place."

Employ any of the time-tested techniques to prevent user [slips](https://www.nngroup.com/articles/slips/) and [mistakes](https://www.nngroup.com/articles/user-mistakes/):

**1. Constraints**<br>
Apply helpful constraints, for example, don't allow users to schedule their blog post publication on a day in the past.

**2. Input size**<br>
Match field size to the length of the expected input, for example, make number inputs much shorter than text inputs.

**3. Default values**<br>
When possible, pre-populate inputs and selections with reasonable default values.

**4. Labels**<br>
Include descriptive labels and only include helpful placeholders.

**5. Required vs. optional**<br>
Indicate all required fields with the asterisk symbol.

**6. Hint text**<br>
Give useful details about inputs or selections using hint text below the field. For example, show the expected date format ("mm-dd-yyyy") below a date picker.

**7. Previews**<br>
Offer real-time previews of user-work when possible, for example, show users how their pricing plan will look on their site as they create it in the Dashboard.

**8. Double check**<br>
Ask users to confirm before destructive and irreversible actions, such as deleting data.

**9. Undo**<br>
Give a chance to "Undo" the most recent action inside its success notification.

**10. Iteration**<br>
Test and iterate the product to identify and fix the sources of common user errors.


<!-- dodont -->
<!-- dodont image -->
![Helper text below date picker to help user enter a correct date](https://wixmp-833713b177cebf373f611808.wixmp.com/images/5ca330e0bb328957087f2fd8cc1f8626.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Give useful details about inputs or selections using hint text below the field.
<!-- end dodont content -->
<!-- end dodont -->


Don't disable submit actions, such as "Save" or "Continue," before required fields are completed as a way to prevent errors.

Disabled actions have a [number of shortcomings](https://docs.google.com/presentation/d/1lOPuTSqFFMLNT7Ahivjdw1eS0WgK9O3SbLXyC-Cz_EU/edit#slide=id.g137c1eafe51_0_15) related to their ambiguity and low accessibility:

* They don't explain what is wrong and create added cognitive load for the users.
* They don't have sufficient contrast and are hard to read.
* They are often skipped by screen readers.


Instead, keep submit actions enabled and allow users to save their progress at their own pace. Show error or success feedback immediately to "[communicate to the user what's actually wrong](https://www.smashingmagazine.com/2021/08/frustrating-design-patterns-disabled-buttons/#an-alternative-to-disabled-buttons)."


<!-- dodont -->
<!-- dodont image -->
![Disabled page actions](https://wixmp-833713b177cebf373f611808.wixmp.com/images/e007e04d9ffd03cac6b031aac5279bd6.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Don't
Don't disable submit actions as a way to prevent errors.
<!-- end dodont content -->
<!-- end dodont -->


<!-- dodont -->
<!-- dodont image -->
![Enabled page actions and error feedback on click](https://wixmp-833713b177cebf373f611808.wixmp.com/images/8b69e1094f0b2da7c4600416e6c6365b.gif)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Allow users to save their progress at their own pace. Show error or success feedback immediately.
<!-- end dodont content -->
<!-- end dodont -->


### 4.2. Validation errors

Validation errors happen when users input information that doesn't meet the expected format or criteria. For example, when a required field is left blank.

Notify users of validation errors immediately:

* Either when users click away from the field ("on blur"),
* or after they submit data to the server.

Community resources offer varied recommendations for both methods. Here are some general guidelines:

* Validate "on blur" in fields with high error rates or specific [formatting requirements](https://www.smashingmagazine.com/2022/09/inline-validation-web-forms-ux/#1-show-errors-immediately-if-issues-are-severe), such as a credit card number, time, or date inputs.
* Avoid validating "on blur" excessively in long forms, as it may [distract users](https://adamsilver.io/blog/the-problem-with-live-validation-and-what-to-do-instead/#2.-validating-when-the-user-leaves-the-field-(onblur)-is-distracting) from [completing the form](https://baymard.com/blog/inline-form-validation).
* Validate required [empty fields on submit](https://www.smashingmagazine.com/2022/09/inline-validation-web-forms-ux/#3-validate-empty-fields-only-on-submit) only.


Test and iterate to find what works best for your product.


<!-- dodont -->
<!-- dodont image -->
![Date picker uses on blur validation](https://wixmp-833713b177cebf373f611808.wixmp.com/images/d36695065328b45d0550e6b387364852.gif)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
For fields with high error rates or specific formatting requirements, validate "on blur."
<!-- end dodont content -->
<!-- end dodont -->


<!-- dodont -->
<!-- dodont image -->
![Empty text input is validated on submit action](https://wixmp-833713b177cebf373f611808.wixmp.com/images/2a195104b34efae46743f19fafd17a67.gif)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Validate required empty fields only after data is submitted.
<!-- end dodont content -->
<!-- end dodont -->


Based on the Wix Design System [usability test](https://docs.google.com/presentation/d/1pjWbZ9vXlT9FFYbwJuD8N4j2TIqkxSUPeiOIbYlMZ0g/edit#slide=id.g1576bdea256_0_110), users primarily pay attention to error messages that are placed next to the source of the issue. For example, if a required text input is left empty, the first thing that catches their attention is the red input border and the inline error message.

When validating form fields, change their status and place the [status message below](#/component/formfield) them as the primary means of error communication.

Give additional feedback with an error status toast that persists until all issues are resolved. 

When a page has a single validation error:

* Show an error message below the field,
* anchor (fast-scroll) and set the focus to the field after the page loads,
* and summarize the problem in the status toast ("Fix the issue to continue").


<!-- dodont -->
<!-- dodont image -->
![Single validation error with inline error message and error notification](https://wixmp-833713b177cebf373f611808.wixmp.com/images/6c9788432b80c61d0ce7e77e28acede6.gif)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
For a single validation error, display a status message below the field, set focus to the field, and summarize the problem in the notification.
<!-- end dodont content -->
<!-- end dodont -->


When a page has multiple validation errors:

* Show error messages below each field,
* anchor (fast-scroll) and set the focus to the first error or warning field after the page loads,
* and summarize the problem in the error toast. For example, "Fix what's needed to continue."


<!-- dodont -->
<!-- dodont image -->
![Multiple validation errors with inline error messages and error notification](https://wixmp-833713b177cebf373f611808.wixmp.com/images/d0939168c4139b475e65ff6a16089b67.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
For multiple validation errors, display status messages below each field, set the focus to the first error field, and summarize the problem in the notification toast.
<!-- end dodont content -->
<!-- end dodont -->


In modals, summarize using status toast at the bottom of the screen as well.


<!-- dodont -->
<!-- dodont image -->
![Error state inside a modal](https://wixmp-833713b177cebf373f611808.wixmp.com/images/25c682c137ddda0e78b770de7c6b7f1b.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
In modals, summarize the problem using a status toast component.
<!-- end dodont content -->
<!-- end dodont -->


### 4.3. Application errors

Errors also occur because of breaches in application logic or conditions, for example when users reach storage limits or their payment method has expired. Such errors usually occur before users even open the app or a specific page, making it essential for them to be visible upon arrival.

Place app errors first in the page, right below the page header using the error [banner](#/component/sectionhelper).

Provide a helpful action or a link for users to resolve issues quickly. Keep the banner visible until the issue is resolved and don't allow users to close it.


<!-- dodont -->
<!-- dodont image -->
![Error banner below the page header](https://wixmp-833713b177cebf373f611808.wixmp.com/images/e675c3e29b3d9a354adbc20cb4a6a9fe.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Place an app level error below the page header.
<!-- end dodont content -->
<!-- end dodont -->


### 4.4. Background task errors

If a system or an app is performing tasks in the background, it's likely that some users will navigate away to other flows or pages while waiting. Thus, it is crucial to keep displaying error messages in the UI until users resolve them.

Wix Media Manager notifies users of upload errors even after they have closed and reopened the app:


<!-- dodont -->
<!-- dodont image -->
![Error state of a background task widget at the bottom of a page](https://wixmp-833713b177cebf373f611808.wixmp.com/images/d381f67655bb09d3e785a21d2b6e24f0.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
For background tasks, show the error message in the UI, until users choose to close it.
<!-- end dodont content -->
<!-- end dodont -->


When the background task is particularly lengthy, like connecting a domain, consider using alternative notification channels. For example, send an email if the task fails or display a prominent red error [section helper](#/component/sectionhelper) on the main page layout.


<!-- dodont -->
<!-- dodont image -->
![Error banner below a page header for app level errors](https://wixmp-833713b177cebf373f611808.wixmp.com/images/128502d5b9d4911bffbe766d7e1b307d.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
For lengthy background tasks, use error section helpers.
<!-- end dodont content -->
<!-- end dodont -->


### 4.5. Loading errors

When a page or modal fails to load, tell users what happened and offer a way forward. Show CTAs to "Try Again," "Refresh," or reach out for support.

Don't leave the page or modal content area completely empty. Instead, use an [empty state](#/component/emptystate) layout with an optional illustration, short title, description, and actions.


<!-- dodont -->
<!-- dodont image -->
![Loading error results in an eplty page](https://wixmp-833713b177cebf373f611808.wixmp.com/images/331e7bdbe57c529d017ba4f79a26d990.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Don't
Don't leave the page or modal content area completely empty.
<!-- end dodont content -->
<!-- end dodont -->


<!-- dodont -->
<!-- dodont image -->
![Loading error is communicated via empty state component](https://wixmp-833713b177cebf373f611808.wixmp.com/images/62f8cb4444aefbe8039123986e1bed2b.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Use an empty state layout in pages and modals that have failed to load.
<!-- end dodont content -->
<!-- end dodont -->


### 4.6. System error

System errors happen because of technical issues and may be out of application scope, such as server overload. They are also identified by 4** and 5** HTTP status codes.

Wix system errors may include:

* 400 Bad Request: server doesn't process the request due to a client error.
* 403 Forbidden: user doesn't have permissions to access a page.
* 404 Not Found: page or resource has been moved, deleted, or never existed.
* 500 Internal Server Error: generic error message.
* 503 Service Unavailable: server is overloaded or down for maintenance.


Depending on context, use an error [status toast](#/component/statustoast) or an [empty state](#/component/emptystate) layout to inform users about the issue. Be as specific as possible and provide a way out, such as a link to troubleshooting or support, or a "Refresh" or "Try again" button. An error toast has no timeout: it stays on screen until the user dismisses it or the error is resolved.


<!-- dodont -->
<!-- dodont image -->
![Error notification informs about a system error](https://wixmp-833713b177cebf373f611808.wixmp.com/images/207feac896223fcb3699a1873ad40ff1.png)
<!-- end dodont image -->
<!-- dodont content -->
#### Do
Use error status toast to inform users about a system error.
<!-- end dodont content -->
<!-- end dodont -->


---

## Accessibility

A huge part of accessible UI state communication is clear and helpful copy. Use plain language, be as specific as possible, and always aim to provide a way forward, in case there's an issue.

To communicate a component's status, show messages directly below the fields. Avoid placing status messages inside tooltips, which are less accessible for screen magnifier, keyboard, screen reader users, and people with cognitive disabilities.

Audit your design for sighted-only status changes and ensure an equivalent experience for screen reader users with a [live region](#/component/liveregion) component. For example, add a status update "Saving changes" when a loading spinner is given to sighted users.


---

## Related components

* [Empty state](#/component/emptystate)
* [Skeleton group](#/component/skeletongroup)
* [Loader](#/component/loader)
* Linear progress bar
* [Circular progress bar](#/component/circularprogressbar)
* [Status toast](#/component/statustoast)
* [Composer header](#/component/composerheader)
* [Section helper](#/component/sectionhelper)
* [Form field](#/component/formfield)
* [Live region](#/component/liveregion)


<br>
<br>
<br>
<br>
<br>