# Create a list

The [**List**](https://docs.acho.io/app-builder/app-construction/elements/layout-elements/list) element is another valuable tool for presenting elements that follow a common pattern. It is to turn data into a more flexible format instead of a tabular format. Compared to [**Table**](https://docs.acho.io/app-builder/app-construction/elements/table-and-chart/table), **Lists** offer the advantage of creating a more dynamic user interface through CSS techniques such as Flex and Grid. The list element digests an JSON array and convert the array to a list of elements with the same pattern.

![](https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FtkZsKkUvtFmjj0vOmOro%2Fimage.png?alt=media\&token=45ccee6d-3a35-43aa-8ab2-2a7a78334d6b)

## Prepare your data

In this tutorial, we will use a sample Shopify products dataset to build the list, you can download the data [here](https://storage.googleapis.com/acho-prod-assets/acho-website-assets/live_demo/sample_products.csv) and [add it to resource](https://docs.acho.io/acho-studio/resources/add-a-resource).&#x20;

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FZ5R3LSBUvUc0zsqT537y%2Fupload_resource.gif?alt=media&#x26;token=c873b767-4764-4fd1-8442-d75181903ca4" alt=""><figcaption></figcaption></figure>

## Create an app

[Create an app](https://docs.acho.io/get-started#3.-create-a-blank-app-or-build-with-a-template.) if you don't have one, or go to the app that you want to add a table

### Drag list element onto page

To add a text to your page, find  **Elements -> List** and drag it onto the page.

### Add elements into list

Make sure the list is on editing mode, then drag a **Text** element into the list and type <mark style="color:red;">`${$item.product_name}`</mark> .  <mark style="color:green;">`${}`</mark> tells the system that you are using an [accessor](https://docs.acho.io/app-builder/app-construction/accessors) to access data. <mark style="color:red;">`$item.product_name`</mark> means to extract the value of the <mark style="color:red;">`product_name`</mark> key in each JSON object.

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FJi6PeHP4QnGA7B3ZJMEg%2Fimage.png?alt=media&#x26;token=4a8a6814-3366-4676-b5c8-db9c4e04b485" alt=""><figcaption></figcaption></figure>

Similarly, add another text and an image into the list, use <mark style="color:red;">`${$item.image_url}`</mark> as the image url and <mark style="color:red;">`${$item.stock}`</mark> for the text. Use container to control the layout

Click the **Preview** button to see the result. As you can see, all the values in your data are shown on the page. &#x20;

![](https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FMCSCpWcJxShimx28PbxO%2Fimage.png?alt=media\&token=210e5886-e65a-4ec6-897a-60bddd8fec5f)

### Use CSS to control list layout

Select the list element and try setting the layout to either "Display: `Flex`" with a direction of "`Row`," or "Display: `Grid`" with columns set to "`1fr 1fr 1fr`"

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FPkZlU9sSFJltYKCWkf0o%2Fimage.png?alt=media&#x26;token=477f4988-0716-46c5-9243-eb0881365246" alt="" width="375"><figcaption><p>Flex + Row</p></figcaption></figure>

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FwrztxwTapfocK6rz99eZ%2Fimage.png?alt=media&#x26;token=3ad107ec-7f6b-4aad-8386-0e354e37df9f" alt="" width="375"><figcaption><p>Gird + 1fr 1fr 1fr</p></figcaption></figure>
