UI States

UI states are used to inform users about the various states a page or container can be.

Usage
Code

UI states are used to inform users about the various states a page or container can be. There can be 4 possible states for a typical workflow:

  1. Loading states
  2. Content placeholders
  3. Error states
  4. Empty states

Principles

  • Load progressively.
  • Skeleton over spinner.
  • Show a progress bar if loading takes more than 1s.
  • If the content or data may be empty after loading, use a spinner.
  • Avoid flicker (showing an element and then removing it).

  • Loading State

    A typical process starts with loading the app first. If we go step by step -

    StateContent typeLoader type
    Loading the appUnpredictableSpinner
    Loading page templatePredictableSkeleton
    Making API callsData can be emptySpinner
    Making API callsData will always be presentSkeleton
    SearchingData can be emptySpinner
    Changing pageData will always be presentSkeleton

    Examples

    Loading the App

    Loading the app

    Loading the Page Template

    Loading the page template

    Making API Calls - Data Can Be Empty

    Making API calls where data can be empty

    Making API Calls - Data Cannot Be Empty

    Making API calls where data cannot be empty

    Searching - Data Can Be Empty

    Searching where data can be empty

    Pagination - Data Cannot Be Empty

    Pagination where data cannot be empty

    Empty States

    Empty state shows that there is no data to display. Such states can be utilized to educate users about the kind of content they can expect along with the next steps that they can take.

    Note: Please refer these comprehensive guidelines about empty states.

    No Data State

    This state occurs when the page is accessed for the first time, hence has no data to display. It should convey what users can expect once data is available, while providing constructive guidance about next steps.

    Note: In such scenarios, a primary call to action can be used, provided there is no other primary call to action on the page.

    No Data State UI state for no data

    Empty State Based on User Action

    These empty states occur as consequences of user-initiated actions:

    No Search Results

    This state indicates that there are no search results and provides guidance on modifying search terms to proceed with the search.

    No search results UI State for no search results

    No Filter Results

    This state indicates the absence of results based on applied filter values and guides users on adjusting the filters to continue.

    No filter results UI State for no filter results

    Error States

    Error states are shown when things don’t go as expected, this could be due to system failure, bad internet, the user trying to perform actions that they don’t have access to, etc.

    Users should be provided with a succinct yet descriptive message along with an action to resolve these error states.

    Following are some of the common error types:

    Failed to Fetch Data

    This state shows up when there are problems in fetching data from the system.

    No to fetch data Error while fetching data

    Page Doesn’t Exist

    This state shows up when the requested page does not exist anymore.

    Page doesn’t exist Page doesn’t exist

    Connectivity Issues

    Error state to convey the lost internet connection.

    Opening/navigating to a New Page

    Error state while opening a new page or navigating to some other links.

    Note: The UI state should go away as soon as either the user click “Try Again” or the system is back online.

    Error while opening a new page with no internet connection Error while opening a new page with no internet connection

    Taking Actions on the Same Page

    For cases when users try to perform any action on the page having no internet, a prompt should be given stating the reason of the failure.

    Note: The prompt will not go away until the system is back online.

    Error while taking action on the page with no internet connection Error while taking action on the page with no internet connection

    Server Unavailable

    This state shows up when the server is unable to handle the request due to temporary overload.

    UI state when server is unavailable UI state when server is unavailable

    Permission Issue

    This state shows up when the user does not have the access to view the requested content.

    Error while viewing the restricted content Error while viewing the restricted content

    Request Timeout

    System throws this error whenever there is a lot of delay in the response of a particular request.

    Error to show request timeout Error to show request timeout

    Flowchart

    Flowchart for a typical UI state


    Was this page helpful?