ListItem¶
ListItem is a row with a title. It can also have a subtitle and an element at each end.
Usage¶
Call Components.ListItem with a scope and a table of properties:
C.ListItem(scope, {
Title = "Ada Lovelace",
Subtitle = "Last seen today",
Leading = C.Avatar(scope, { Initials = "AL" }),
OnClick = function()
print("Open profile")
end,
})
Properties¶
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
Theme |
ThemeRef |
The contextual theme | Theme to use for this component instead of the one from Theme.Provide. |
|
LayoutOrder |
UsedAs<number> |
0 |
Position in a parent UIListLayout or UIGridLayout. |
|
Size |
UsedAs<UDim2> |
- | Size of the component. | |
Visible |
UsedAs<boolean> |
true |
Whether the component is shown. | |
ZIndex |
UsedAs<number> |
- | Z index of the component. | |
Title |
UsedAs<string> |
- | Main text of the row. | |
Subtitle |
UsedAs<string> |
- | Smaller text under the title. | |
Leading |
Instance |
- | Element at the start of the row, such as an Avatar or an Icon. | |
Trailing |
Instance |
- | Element at the end of the row. | |
Disabled |
UsedAs<boolean> |
false |
Stops the row reacting to input. The component reads this once, when it creates the row. |
Callbacks¶
| Name | Description |
|---|---|
OnClick: () -> () |
Runs when the user activates the row. |