mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
[#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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user