Thinking in Aurora
Aurora redefines UI development, adopting a component-based approach. Break designs into components, define states, and behaviors, then seamlessly connect components for data flow. Create intuitive in
Step 1: Define the JSON API and Mockup
Assuming we have a JSON API returning product data like this:
jsonCopy code[
{ "category": "Fruits", "price": "$1", "stocked": true, "name": "Apple" },
{ "category": "Fruits", "price": "$1", "stocked": true, "name": "Dragonfruit" },
{ "category": "Fruits", "price": "$2", "stocked": false, "name": "Passionfruit" },
{ "category": "Vegetables", "price": "$2", "stocked": true, "name": "Spinach" },
{ "category": "Vegetables", "price": "$4", "stocked": false, "name": "Pumpkin" },
{ "category": "Vegetables", "price": "$1", "stocked": true, "name": "Peas" }
]And a mockup representing the UI:
[Mockup Image]
Step 2: Break Down the UI into Components
We'll identify the following components based on the mockup:
FilterableProductTable: Main container for the app.SearchBar: Component to receive user input for searching.ProductTable: Component to display and filter the product list.ProductCategoryRow: Component to display category headings.ProductRow: Component to display individual product rows.
Step 3: Build a Static Version
We'll start by building a static version of the app without interactivity. We'll focus on reusability and passing data through props.
Step 4: Manage State
Identify the minimal but complete representation of UI state. In this case, it includes the search text and the value of the checkbox.
Step 5: Add Interactivity
Now, add inverse data flow to update the state based on user input.
Now, you have a fully functional searchable product data table in Aurora! You can further enhance this implementation with styling and additional features as needed. Happy coding! 🚀
Last updated