Clear horizontal list
Function: Clear horizontal list
This action allows you to instantly remove all items from a horizontal list display in your application. It's useful for resetting a list, clearing selections, or preparing a list for new content.
Input
- List ui element
- Description: The specific horizontal list component on your screen that you want to clear.
- Type: UI Element (specifically a Horizontal List)
Output
This action does not produce a direct output value. Instead, it modifies the specified horizontal list component by removing all its contents.
Execution Flow
Real-Life Examples
Here are some practical ways you can use the "Clear horizontal list" action in your application:
Example 1: Resetting a Product Showcase
Imagine you have a "Featured Products" section on your homepage, displayed as a horizontal list. After a promotional period, you want to clear these products to make way for new ones.
- Inputs:
List ui element: "Featured Products Display"
- Result: All products previously shown in the "Featured Products Display" horizontal list are removed, leaving it empty and ready for new product additions.
Example 2: Clearing a Shopping Cart Selection
In an order form, users might add multiple items to a "Selected Items" horizontal list. If they decide to start over, you can provide a "Clear Cart" button.
- Inputs:
List ui element: "Items in Cart"
- Result: All items that were added to the "Items in Cart" horizontal list are instantly removed, effectively emptying the user's selection.
Example 3: Refreshing a Dashboard Widget
A dashboard might have a "Recent Notifications" widget displayed as a horizontal list. After a user has reviewed all notifications, you might want to clear the list to show only new, unread items.
- Inputs:
List ui element: "Recent Notifications Feed"
- Result: The "Recent Notifications Feed" horizontal list on the dashboard is cleared, providing a clean slate for new incoming alerts.