Show/Hide
Show/Hide is used to show more of the same content that is already visible. For example a list of items or attributes that is longer than its initial container view allows.
Lacinia neque, sit amet dictum enim enim ut libero. Pellentesque sagittis tellus.
This content is hidden by default. Lacinia neque, sit amet dictum enim enim ut libero. Pellentesque sagittis tellus.
Custom labels example...
This example uses the opened-label and closed-label attributes.
Open by default example
This content is visible by default because of the open attribute.
certara-show-hide
Section titled “certara-show-hide”Properties
Section titled “Properties”closedLabel
| Attribute | closed-label |
| Type | string |
| Default | 'Show more' |
| Required | false |
| Description | Default label for closed state |
open
| Attribute | open |
| Type | boolean |
| Default | false |
| Required | false |
| Description | Hidden content will be visible |
openedLabel
| Attribute | opened-label |
| Type | string |
| Default | 'Show less' |
| Required | false |
| Description | Default label for opened state |
Events
Section titled “Events”| Name | Description | Bubbles |
|---|---|---|
certaraClick | true |
Methods
Section titled “Methods”There are no public methods available for this component
| Name | Description |
|---|---|
| Container for visible content | |
hidden-content | Container for the hidden content |
Show/Hide is used to show more of the same content that is already visible. For example a list of items or attributes that is longer than its initial container view allows.
Design guidelines
Section titled “Design guidelines”Lacinia neque, sit amet dictum enim enim ut libero. Pellentesque sagittis tellus.
Lacinia neque, sit amet dictum enim enim ut libero. Pellentesque sagittis tellus. Lacinia neque, sit amet dictum enim enim ut libero. Pellentesque sagittis tellus.
In practice
Section titled “In practice”The Show/Hide uses the link button style with left icon placement. It includes the plus (+) icon by default and is labeled “Show More”. When selected, the icon changes to a minus (-) and the label changes to “Show Less”.
Use Show/Hide in sections or containers that are compact but include additional information that should be accessible. This component is generally used individually as needed and does not appear in groups.
Accessibility
Section titled “Accessibility”- Show/Hide is keyboard operable.
- The Show/Hide requires javascript. Creating this widget in a frontend framework (or with vanilla javascript) would involve:
- A
button(or a control withrole=“button”) that acts as the control that toggles display. - Adding aria-expanded with either true or false to convey to assistive technology whether the widget is expanded or not.
- Adding aria-controls with with the value of the id from the element whose visibility is being toggled. Screen reader support for this is sparse, but this association may allow for easier reference via CSS or script.
- A
- For more information, see our accessibility guidelines.