Unordered List
Displays a bulleted list of related items. Use to present collections of items or options where the sequence isn’t critical.
Anchor to listitemListItem
Represents a single item within an unordered or ordered list. Use only as a child of s-unordered-list
or s-ordered-list
components.
ListItem
- adoptedCallback
() => void
- attributeChangedCallback
(name: string) => void
- click
Like the standard `element.click()`, but you can influence the behavior with a `sourceEvent`. For example, if the `sourceEvent` was a middle click, or has particular keys held down, components will attempt to produce the desired behavior on links, such as opening the page in the background tab.
({ sourceEvent }?: ClickOptions) => void
- connectedCallback
() => void
- disconnectedCallback
() => void
- queueRender
Queue a run of the render function. You shouldn't need to call this manually - it should be handled by changes to @property values.
() => void
- setAttribute
(name: string, value: string) => void
declare class ListItem extends PreactCustomElement implements ListItemProps {
constructor();
}
ClickOptions
- sourceEvent
The event you want to influence the synthetic click.
ActivationEventEsque
export interface ClickOptions {
/**
* The event you want to influence the synthetic click.
*/
sourceEvent?: ActivationEventEsque;
}
ActivationEventEsque
- button
number
- ctrlKey
boolean
- metaKey
boolean
- shiftKey
boolean
export interface ActivationEventEsque {
shiftKey: boolean;
metaKey: boolean;
ctrlKey: boolean;
button: number;
}
Was this section helpful?
Code
<s-unordered-list>
<s-list-item>Red shirt</s-list-item>
<s-list-item>Green shirt</s-list-item>
<s-list-item>Blue shirt</s-list-item>
</s-unordered-list>
examples
Code
<s-unordered-list> <s-list-item>Red shirt</s-list-item> <s-list-item>Green shirt</s-list-item> <s-list-item>Blue shirt</s-list-item> </s-unordered-list>
<!DOCTYPE html><html><head><style>html, body {height:100%} body {box-sizing: border-box; margin: 0; padding:0.5rem; display: grid; place-items: center; gap: 0.5rem;}</style><script src="https://cdn.shopify.com/shopifycloud/app-bridge-ui-experimental.js"></script></head><body><s-unordered-list> <s-list-item>Red shirt</s-list-item> <s-list-item>Green shirt</s-list-item> <s-list-item>Blue shirt</s-list-item> </s-unordered-list> </body></html>