1e41f4b71Sopenharmony_ci# list-item
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci>  **NOTE**
4e41f4b71Sopenharmony_ci>
5e41f4b71Sopenharmony_ci>  This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci**\<list-item>** is a child component of the **[\<list>](js-components-container-list.md)** component and is used to display items in a list. You can customize the width of each **\<list-item>**. However, if you retain the default value **stretch** of **align-items** for the parent component **\<list>**, the width of **\<list-item>** is equal to that of **\<list>**. To make the customized **\<list-item>** width take effect, set **align-items** to other values rather than **stretch**.
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci## Required Permissions
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ciNone
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci
14e41f4b71Sopenharmony_ci## Child Components
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ciThis component supports only one child component.
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci## Attributes
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ciIn addition to the [universal attributes](js-components-common-attributes.md), the following attributes are supported.
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci| Name| Type| Default Value| Mandatory| Description|
24e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- |
25e41f4b71Sopenharmony_ci| type | string | default | No| Type of the list-item. A list can contain multiple list-item types. The same type of list items should have the same view layout after being rendered. When the type is fixed, replace the **if** attribute with the **show** attribute to ensure that the view layout remains unchanged.|
26e41f4b71Sopenharmony_ci| primary | boolean | false | No| Whether the item is the primary item in the group. The value **true** indicates that the item is the primary item in the group, which is the item that appears in a collapsed group. If there is more than one item marked as primary, the first one is the primary item. If there is no item marked as primary, the first item is the primary item.|
27e41f4b71Sopenharmony_ci| section | string | - | No| String used to match the item. This attribute can be left empty. The value cannot be dynamically updated. In a list item group, only the string set for the primary item is valid.|
28e41f4b71Sopenharmony_ci| sticky | string | none | No| Whether the current item sticks in place at the top, and the effect when it disappears. This attribute supports vertical lists only and is invalid for items in a group.<br>- **none**: The current item does not stick at the top.<br>- **normal**: The current item sticks at the top and disappears with a sliding effect.<br>- **opacity**: The current item sticks at the top and disappears gradually. This option is only supported on wearables.|
29e41f4b71Sopenharmony_ci| clickeffect<sup>5+</sup> | boolean | true | No| Whether an effect is displayed when the current item is clicked.<br>- **false**: No effect is displayed when the item is clicked.<br>- **true**: An effect is displayed when the item is clicked.|
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ci## Styles
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ciIn addition to the [universal styles](js-components-common-styles.md), the following styles are supported.
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci| Name| Type| Default Value| Mandatory| Description|
37e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- |
38e41f4b71Sopenharmony_ci| column-span | &lt;number&gt; | 1 | No| Number of columns occupied by the current list-item in the list. By default, the list-item occupies one column. This attribute is valid only when the list contains multiple columns.|
39e41f4b71Sopenharmony_ci
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ci## Events
42e41f4b71Sopenharmony_ci
43e41f4b71Sopenharmony_ciIn addition to the [universal events](js-components-common-events.md), the following events are supported.
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ci| Name| Parameter| Description|
46e41f4b71Sopenharmony_ci| -------- | -------- | -------- |
47e41f4b71Sopenharmony_ci| sticky | { state: boolean } | Callback event for a sticky component.<br>**value: false**: The current item is not in the sticky state.<br>**value: true**: The current item is in the sticky state.<br>This event is supported only when the item is configured with the **sticky** attribute.|
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci## Methods
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ciThe [universal methods](js-components-common-methods.md) are supported.
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ci
54e41f4b71Sopenharmony_ci## Example
55e41f4b71Sopenharmony_ci
56e41f4b71Sopenharmony_ciFor details, see [Example in list](js-components-container-list.md#example).
57