From 5642c2998689c9ae547022c5e4115e0f15e720fe Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Wed, 20 May 2026 20:19:28 +0200 Subject: [PATCH] [#75029] Document header parameters and slots Surfaces the keywords accepted by `with_header` and its sub-slots (`with_description`, `with_action_button`, `with_menu`) in dedicated tables so readers do not need to inspect the component source. https://community.openproject.org/wp/75029 --- .../docs/components/border-box-list.md.erb | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lookbook/docs/components/border-box-list.md.erb b/lookbook/docs/components/border-box-list.md.erb index 711799100c9..f0bf434534f 100644 --- a/lookbook/docs/components/border-box-list.md.erb +++ b/lookbook/docs/components/border-box-list.md.erb @@ -44,7 +44,7 @@ comparable lists should use headers. | Slot | Description | |---|---| -| `with_header` | Optional section header with title, count, description, action buttons, and menu. Pass `title_arguments:` to customize the heading | +| `with_header` | Optional section header. See [Header parameters](#header-parameters) and [Header slots](#header-slots) below | | `with_item` | Generic list row that renders the provided block content | | `with_work_package_item` | Work package row that renders a work package card | | `with_empty_state` | Empty-state content rendered when no items are present | @@ -52,6 +52,27 @@ comparable lists should use headers. ## Header +### Header parameters + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `title` | `String` | required | Header title | +| `title_tag` | `Symbol` | `:h4` | HTML tag for the title heading | +| `title_arguments` | `Hash` | `{}` | Forwarded to the title heading element | +| `count` | `Integer`, `Boolean`, `nil` | `nil` | Pass `true` to infer the rendered item count, an integer for an explicit value, or `nil`/`false` to hide it | +| `count_arguments` | `Hash` | `{}` | Forwarded to `Primer::Beta::Counter`. Merged over defaults (`scheme: :primary`, `hide_if_zero: true`) | +| `collapsed` | `Boolean` | `false` | Whether a collapsible header starts closed | + +### Header slots + +| Slot | Description | +|---|---| +| `with_description` | Secondary content below the title, wrapped in `Primer::Beta::Text` with muted color by default. Accepts Primer system arguments | +| `with_action_button` | Button rendered in the header actions area | +| `with_menu` | Action menu rendered in the header actions area. Pass `button_aria_label:` for the trigger button | + +### Collapsible headers + Collapsible headers add: - an **arrow indicator** next to the title to show whether the section is