the-collab-lab / tcl-74-smart-shopping-list

1 stars 0 forks source link

14.2 Create `<Disclosure>` component #33

Closed mxmason closed 3 weeks ago

mxmason commented 3 weeks ago

Summary

A disclosure allows users to expand and collapse sections of content. Most notably, we'll use it to show and hide a user's lists.

Wireframe

Acceptance criteria

Conceptually, a disclosure is comprised of two parts: a trigger, which users interact with to control the state of the component, and content, which contains the content that is expanded and collapsed by the trigger.

Trigger requirements

Content requirements

Example markup

<div class="Disclosure" id="disclosure-1">
  <button
    class="Disclosure-button"
    id="disclosure-1-button" 
    aria-controls="disclosure-1-content"
    aria-expanded="false"
  >
    <!-- Icon here -->
    <span>
      <!-- Button text here -->
    </span>
  </button>
  <div class="Disclosure-content" id="disclosure-1-content">
    <!-- Content here -->
  </div>
</div>

Notes