component ListGroup { outputs { select(payload: { value?: string | number | boolean | null; values?: Array; sourceEvent?: Event; [key: string]: string | number | boolean | null | object } | string | number | boolean | null) change(payload: { value?: string | number | boolean | null; values?: Array; sourceEvent?: Event; [key: string]: string | number | boolean | null | object } | string | number | boolean | null) } props { size: string = "default" color: string = "primary" title: string = "List Group" description: string = "" items: unknown[] = [] variant: string = "default" value: string = "" class: string = "" } state selectedValue = value functions { client function choose(item, index) { if (item.disabled) { return } selectedValue = String(item.value || index) output.select({ value: selectedValue, item: item, index: index }) output.change({ value: selectedValue, item: item, index: index }) } } view {
{#if title}{title}{/if}{#if description}

{description}

{/if}
{#each items as item, index}{/each}
} style { .wrn-list-group { display:grid; gap:.75rem; color:var(--wrn-color-text); } .wrn-list-group > p { margin:0; font-size:.875rem; color:var(--wrn-color-muted); } .wrn-list-group__items { border: 1px solid var(--wrn-color-border); border-radius: var(--wrn-radius); overflow: hidden; box-shadow: var(--wrn-shadow-1); } .wrn-list-group button { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .75rem 1rem; text-align: start; border: 0; color: inherit; background: var(--wrn-color-surface); font: inherit; font-size: .875rem; cursor: pointer; transition: background-color 120ms ease; } .wrn-list-group button + button { border-top:1px solid var(--wrn-color-border); } .wrn-list-group button[aria-pressed="true"] { background: color-mix(in srgb, var(--wrn-color-primary) 8%, var(--wrn-color-surface)); color: var(--wrn-color-text); box-shadow: inset 2px 0 0 var(--wrn-color-primary); } .wrn-list-group button > [class*="icon-"] { width:1.1rem; height:1.1rem; flex:none; } .wrn-list-group small { display:block; margin-top:.2rem; color:var(--wrn-color-muted); font-size:.8rem; } .wrn-list-group__badge { margin-inline-start:auto; font-size:.75rem; } .wrn-list-group button:disabled { opacity:.5; cursor:not-allowed; } } }