Surfaces and display
Accordion and disclosure
Sections that open and close. .kui-accordion frames several native <details>; details.kui-disclosure is one quiet “show more”. Both work without JavaScript, and find-in-page opens a closed one.
Examples
An accordion where one section is open at a time
Give the <details> of one accordion the same name: opening one closes the other.
Ko je obveznik poreza na imovinu?
The owner of a flat, a house, an office or land in Serbia on 1 January. A tenant with a lease longer than one year pays it too.
When is the tax paid?
In four instalments: by 14 February, 15 May, 14 August and 14 November.
Kann ich die Grundsteuerbescheinigung elektronisch anfordern?
Yes, through the eUprava portal, with a qualified electronic certificate.
The certificate arrives in your inbox within three working days.
<div class="kui-accordion">
<details name="accordion-faq" open>
<summary>Ko je obveznik poreza na imovinu?</summary>
<div class="kui-accordion__body"><p>The owner of a flat, a house, an office or land in Serbia on 1 January. A tenant with a lease longer than one year pays it too.</p></div>
</details>
<details name="accordion-faq">
<summary>When is the tax paid?</summary>
<div class="kui-accordion__body"><p>In four instalments: by 14 February, 15 May, 14 August and 14 November.</p></div>
</details>
<details name="accordion-faq">
<summary>Kann ich die Grundsteuerbescheinigung elektronisch anfordern?</summary>
<div class="kui-accordion__body"><p>Yes, through the eUprava portal, with a qualified electronic certificate.</p><p>The certificate arrives in your inbox within three working days.</p></div>
</details>
</div>
A disclosure
For an explanation that most people do not need.
Why do we ask for your JMBG?
The tax office identifies a person by the JMBG. We send it only with your return and do not keep it afterwards.
<details class="kui-disclosure">
<summary>Why do we ask for your JMBG?</summary>
<div class="kui-disclosure__body"><p>The tax office identifies a person by the JMBG. We send it only with your return and do not keep it afterwards.</p></div>
</details>
States
Every state
Closed: the arrow points down. Open: it points up and the body shows; with motion allowed the body grows smoothly. Hover gives the summary a soft fill; focus shows the ring inside. A long question wraps beside the arrow.
Closed
Hidden content.
Open
Shown content.
Da li se porez na imovinu plaća i za garažu, ostavu ili parking mesto koje se nalazi u istoj zgradi kao stan?
Yes, each part is taxed.
<div class="kui-accordion">
<details><summary>Closed</summary><div class="kui-accordion__body"><p>Hidden content.</p></div></details>
<details open><summary>Open</summary><div class="kui-accordion__body"><p>Shown content.</p></div></details>
<details><summary>Da li se porez na imovinu plaća i za garažu, ostavu ili parking mesto koje se nalazi u istoj zgradi kao stan?</summary><div class="kui-accordion__body"><p>Yes, each part is taxed.</p></div></details>
</div>
Classes and attributes
.kui-accordion- The frame around several details.
details[name]- One section; details with the same name open one at a time.
summary- The heading that opens and closes it.
.kui-accordion__body- The content.
details.kui-disclosure, .kui-disclosure__body- A single quiet section, with an arrow before its summary.
open- On details: open at the start.
Keyboard
- Tab
- Moves from summary to summary, and into an open section.
- Enter or Space
- Opens or closes the section.
Accessibility
- A summary is a button to assistive technology and says whether it is expanded.
- Put the question in words in the summary; the arrow is drawn by CSS.
- Find in page opens a closed section that holds the words found.
- If the summaries are the page’s headings, put a heading element inside the summary.
Do and do not
Do
- Use an accordion for answers people look up one at a time.
- Write summaries as the question or the name of the section.
- Open the section a person came for, from the address.
Do not
- Do not hide the steps of a task in an accordion.
- Do not nest accordions.
- Do not put the only important warning in a closed section.