Managing Child Objects
How to show, hide, and edit details of child objects related to a parent within a form context.
This pattern improves productivity by focusing a user's attention solely on the current object of interest, and uses collapsible objects to show or hide detail as needed. The intent is that collapsible objects reduce noise, clutter, and cognitive overload by hiding extraneous detail — and an easy means to view detail when needed.
When to use
Use when a user's primary task is to create or configure a parent resource, but creating, updating, or removing child objects is a sub-task. This pattern provides users easy control over displaying detail as needed.
Anatomy
The following illustrates the elements composing a child object in its collapsed and expanded states. View the examples to see how child objects behave and are presented in a form context.
Collapsed state
Object's name
Summary of select object values, truncated if neededLabel | Region | Purpose | Required | Notes |
---|---|---|---|---|
1 | Container | Identfies the child and controls the show detail behavior. | The entirety of the container is focusable and expands to show detail with a mouse click, Enter key, or Spacebar. The aria-label should read "Show and edit detail." | |
2 | Label | Uniquely identifies each child object. | Should be implemented as a semantically correct heading to allow screen reader users to traverse between children. | |
3 | Expand icon | Visual treatment indicating show detail behavior. | Icon name is "FormDown". | |
4 | Values summary | A preview summarizing the object's detail. | Optional | Use "truncate" on Text to allow the summary to truncate if there is not sufficient width. |
5 | Border | Border is on top and bottom of child object. color="border-weak" |
Expanded state
Object's name
Label | Region | Purpose | Required | Notes |
---|---|---|---|---|
1 | Header | Identifies the child and controls the hide detail behavior. | The entirety of the container is focusable and hides detail with a mouse click, Enter key, or Spacebar. The aria-label should read "Hide detail." | |
2 | Label | Uniquely identifies each child object. | Should be implemented as a semantically correct heading to allow screen reader users to traverse between children. | |
3 | Collapse icon | Visual treatment indicating hide detail behavior. | Icon name is "FormUp". | |
4 | Body | Flexible region for presenting an object's detail. | Detail presentation may vary by the use case. | |
5 | Remove button | Removes/deletes the child from its parent. | Case depending | Always provide unless at least one child object is required by the parent. See Required children for detail. Icon name is "Trash". |
Examples
Optional children
Use cases where child objects are not required by the parent may use a semantically correct heading, optional description, and a secondary button labelled with an add action to the form.
Create role
Required children
For convenience, use cases where a parent can not be created without associating at least one child (e.g. creating a cluster) may present the first child object in its expanded state.
Create Cluster
Remove all action
When multiple children are associated with the parent, consider including a "Remove all" button to allow a user the ability to easily remove all associations with a single action.
Edit role
Still have questions?
Something missing or looking for more information? Get in touch to help make the HPE Design System better.