diff --git a/third_party/aria-practices/src/content/patterns/disclosure/examples/disclosure-card.html b/third_party/aria-practices/src/content/patterns/disclosure/examples/disclosure-card.html index 3d409091e9f4e..16935b94e8615 100644 --- a/third_party/aria-practices/src/content/patterns/disclosure/examples/disclosure-card.html +++ b/third_party/aria-practices/src/content/patterns/disclosure/examples/disclosure-card.html @@ -2,88 +2,13 @@ - Example Disclosure (Show/Hide) Card - - - - - - - - - -
-

Example Disclosure (Show/Hide) Card

- -
-

About This Example

- -

- The following example demonstrates using the Disclosure Pattern to create an - expandable card. -

-

- Authors sometimes want to display a summary of content in a collapsed disclosure that includes content that is more rich or complex than a plain text summary. - In addition, they may want to enable users of pointing devices to toggle the expanded state by clicking anywhere within the visible boundaries of the collapsed summary. - Authors may assume these goals can be achieved by nesting the entire rich summary within a disclosure button. However, doing so can: -

- -

- The following example avoids these problems by modifying the structure - of the basic disclosure pattern. Instead of having the entire summary - contained within a button that controls a separate details container, - it nests the expand and collapse disclosure button within an article - element that presents a card. When the card is collapsed, it presents - a rich summary and the disclosure button. When the card is expanded, - its content also includes the additional details content. This - structure allows the summary to include headings, links, or any other - type of rich content while also enabling the disclosure button to have - a concise, understandable accessible name. Finally, some light - JavaScript makes the entire card clickable, so its pointer - interactions are similar to the summary of a basic disclosure. -

-

Similar examples include:

- -
- -
-
-

Example

-
-

Musical Education Conference

@@ -358,267 +283,5 @@
- -
- -
-

Accessibility Features

- -
- -
-

Keyboard Support

- - - - - - - - - - - - - - - - - -
KeyFunction
- Tab - Moves keyboard focus to the disclosure button.
- Space or
- Enter -
- Activates the disclosure button, which toggles the - expanded/collapsed state of the card. -
-
- -
-

Role, Property, State, and Tabindex Attributes

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RoleAttributeElementUsage
- aria-controls="ID_REFERENCE" - buttonIdentifies the element controlled by the disclosure button.
- aria-expanded="false" - - button - -
    -
  • Indicates that the container controlled by the disclosure button - is hidden.
  • -
  • - CSS attribute selectors (e.g. - [aria-expanded="false"]) are used to synchronize the - visual states with the value of the aria-expanded - attribute. -
  • -
-
- aria-expanded="true" - - button - -
    -
  • Indicates that the container controlled by the disclosure button - is visible.
  • -
  • - CSS attribute selectors (e.g. [aria-expanded="true"]) - are used to synchronize the visual states with the value of the - aria-expanded attribute. -
  • -
-
articlearticle -
    -
  • - This does not have to be declared in the code because it is - implicit in the HTML article element. -
  • -
  • - Enables screen reader users to perceive the boundaries of - each card and easily move a reading cursor from card to - card. -
  • -
-
-
- -
-

JavaScript and CSS Source Code

- - -
- -
-

HTML Source Code

-

To copy the following HTML code, please open it in CodePen.

- -
- - -
-