About
A simple list container that renders child elements in a vertical stack with consistent spacing.
When the selectable attribute is set, items become clickable and the component
fires ars-list:select events with { index, item } detail.
Static List (non-selectable)
π Apple
π Banana
π Cherry
π Grape
<ars-list>
<div class="list-item">π Apple</div>
<div class="list-item">π Banana</div>
<div class="list-item">π Cherry</div>
</ars-list>
Selectable List
Click an item to select it. Fires ars-list:select.
π¨ Inbox
π€ Sent
π Drafts
β Starred
ποΈ Trash
<ars-list selectable>
<div class="list-item">π¨ Inbox</div>
<div class="list-item">π€ Sent</div>
</ars-list>
With Mixed Content
Task 1 β Design review
Task 2 β API integration
Task 3 β Unit tests
Event Monitor
Listening for ars-list:selectβ¦
Theme Toggle
Usage
<ars-list selectable>
<div>Item 1</div>
<div>Item 2</div>
</ars-list>
<script type="module">
import { ArsList } from 'ars-web-components';
document.querySelector('ars-list')
.addEventListener('ars-list:select', (e) => {
console.log('Selected index:', e.detail.index);
});
</script>