Component API

<chevron-panel>

Open live example

A generic disclosure: a clickable header that expands/collapses a body,
with a chevron that rotates to reflect state. Headline and body are both
slotted, so any markup can go in either — unlike chat-message's
built-in collapsible mode, which only slots the body and builds its
header from discrete properties (author/timestamp/summary).

Install

import "@f-ewald/components/chevron-panel.js";

Usage

<chevron-panel>
  <strong slot="headline">Why these scores?</strong>
  <p>Each category blends several weighted inputs.</p>
</chevron-panel>
<script type="module">
  document.querySelector("chevron-panel").addEventListener("toggle", (e) => {
    console.log(e.detail.open);
  });
</script>

Attributes / properties

PropertyAttributeTypeDefaultDescription
openopenbooleanfalseWhether the body is currently expanded.

Events

EventDescription
toggleFired with { open: boolean } when the header is clicked.

Slots

SlotDescription
(default)Body content, shown only while open.
headlineHeader content, always visible, clickable to toggle.

CSS custom properties

Custom property
--ui-focus-ring
--ui-font
--ui-radius-sm
--ui-text
--ui-text-muted