<!-- GENERATED by scripts/build-llms.mjs from llms/retrieval.md — do not edit this file. -->

# `lr-community-card`

- **Import** `import '@aceshooting/lyra-ui/components/lr-community-card.js';` (stable tag alias; registers the tag)
- **Class** `LyraCommunityCard`, also available unregistered from `@aceshooting/lyra-ui/components/retrieval/community-card/community-card.class.js`
- **Family** `components/retrieval/` — see `llms/index.md` for its siblings
- **Status** `stable` since `4.0.0` — see the maturity and deprecation policy in `llms/shared.md`
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
- **Deprecations** none
- **Optional peers** none
- **Themeable via** 11 parts, 1 custom property — see this component's own `@csspart`/`@cssprop` list below
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`

---

## `lr-community-card`

A cluster/community summary card (GraphRAG community report): label, LLM summary excerpt, member
count, member chips with overflow, and a drill-in action. Doesn't own community rendering on the
graph or membership fetching — `lr-drill` asks the host to load members/subgraph.

**Properties:**

- `community: LyraCommunity | null = null` (attribute: false) — `LyraCommunity { id: string; label:
string; summary?: string; memberCount?: number }`; `memberCount` is a non-negative safe-integer
  total for paged data and is authoritative only when it is at least `members.length`; a smaller or
  invalid total cannot contradict the known rendered records; `null` renders the empty state
- `members: LyraEntity[] = []` (attribute: false) — rendered as chips, up to `maxMembers`
- `maxMembers: number = 8` (attribute `max-members`) — remaining members collapse into a "+N"
  overflow chip
- `compact: boolean = false` (reflected) — omits the summary excerpt and member chips
- `frame: LyraFrame = 'card'` (reflected) — container treatment, in the library-wide `frame`
  vocabulary (`'card' | 'plain'`), the same property this component's sibling `lr-entity-card`
  carries. `'card'` (the default) keeps the bordered, filled, padded box; `'plain'` removes the
  border, background, and padding, so a card nested inside a container that already draws a border
  doesn't double it. The exported alias `CommunityCardAppearance` is retained as a name for the same
  union.

**Events:** `lr-drill` (`detail: { communityId }`, the drill button, header, or overflow chip — all three
mean "show me this whole community"), `lr-entity-activate` (`detail: { entityId }`, a member chip was
activated).

**Slots:** `actions` — extra header actions alongside the built-in drill button.

**CSS parts:** `base`, `header`, `title` (`role="heading" aria-level="3"` wrapping a `<button>`),
`member-count`, `summary` (omitted in `compact`), `members` (omitted in `compact`), `member`,
`overflow` (the "+N" chip button), `drill-button`, `actions`, `empty` (shown when `community` is
`null`).

**Themeable custom properties:** `--lr-community-card-bg` (default `var(--lr-color-surface)`) —
`[part='base']`'s RESTING background, so a panel retinting its `lr-entity-card`/`lr-source-card`
siblings can retint this card with it; `frame='plain'` still drops the fill entirely. Otherwise
shared tokens.

**Optional peer deps:** none.

```html
<lr-community-card></lr-community-card>
<script>
  document.querySelector("lr-community-card").community = {
    id: "c1",
    label: "Early computing pioneers",
    summary: "A cluster of 19th-century mathematicians and engineers.",
    memberCount: 12,
  };
</script>
```

**Known gotchas:**

- `memberCount` (not `members.length`) is the authoritative displayed count whenever it's larger —
  useful when the host sends only a preview slice of members alongside the real total.
- A blank community id renders the empty state. Members with blank ids and later duplicates are
  omitted first-wins before count fallback, overflow, rendering, or events.

---
