Standard disclosure widgets
Use either disclosure-inline
(for display: inline-block
) or
disclosure-block
(for display: block
) custom elements as the wrappers.
Either wrapping element must contain a <disclosure-content>
element.
This element represents the content you want to show/hide.
A trigger (<button>
element) will be auto-generated with the fallback text of “More info”.
<disclosure-inline>
<disclosure-content>
...
</disclosure-content>
</disclosure-inline>
disclosure-inline
If the script didn’t run, this content would have just been hanging out there for you to read.
<disclosure-block>
<disclosure-content>
...
</disclosure-content>
</disclosure-block>
disclosure-block
If the script didn’t run, this content would have just been hanging out there for you to read.
Give your triggers unique labels
Use the data-trigger
attribute on the disclosure parent element to specify a name for
the auto-generated trigger (<button>
element).
<disclosure-inline
data-trigger="My Name!!!">
...
</disclosure-inline>
If the script didn’t run, this content would have just been hanging out there for you to read.
Adjust the down arrow position
Use the data-left-align
attribute to have the down arrow / chevron appear prior to the trigger’s visible label.
If the script didn’t run, this content would have just been hanging out there for you to read.
Identify where to generate the trigger
Maybe you need more flexibility on where your disclosure widget trigger is generated.
Use the data-insert-trigger
attribute to override the default placement,
and instead inject the trigger into that particular element.
This text exists as the first child element of the disclosure-block
.
Following this paragraph is a <div data-insert-trigger>
.
The trigger will be injected into that element.
As another example, what follows is a nested disclosure widget, but its trigger
has been disabled by default (using the data-disabled
attribute on
the parent <disclosure-inline>
element).
This link is here just for focus testing.
Hey! You weren’t supposed to get to me…
Make it ‘pop’
Use the data-popup
attribute to have the disclosure widget content absolutely positioned.
The popup content will allow for keyboard focus to enter it and interact with the content.
Tabbing away will close the disclosure widget. The Esc key will also close the disclosure widget
when keyboard focus is on the trigger, or within the disclosure widget’s content panel.
<disclosure-inline data-popup>
<disclosure-content role=note>
...
</disclosure-content>
</disclosure-inline>
I have a role=note
. You don’t have to add this, but if you’d like to learn more about this role, check out the ARIA specification.
Inject a trigger into a heading
The following are some examples of ways to have a disclosure widget trigger within a heading.
The first of which is a button as a sibling to the heading’s text.
The second example is a button that takes the entirety of the heading’s content and includes it as
child content of the injected button element. Make sure you use this with caution,
as you don’t want links or other interactive elements as child elements to the injected button.
<disclosure-inline>
<h5>
Heading with adjacent toggle
<span data-insert-trigger="inline"></span>
</h5>
<disclosure-content>
...
</disclosure-content>
</disclosure-inline>
Heading with adjacent toggle
Sometimes you don’t want your full heading to be clickable. Sometimes.
<disclosure-block data-open>
<h5 data-insert-trigger>
<img src=... alt style=...>
<span style=...>...</span>
</h5>
<disclosure-content>
...
</disclosure-content>
</disclosure-block>
Disclosure button within a heading
This disclosure widget is opened by default.
Because that’s a thing that should be able to happen.
Here’s an example of a nested popup disclosure widget:
This example has a link within it.
popups can be closed via the Esc key, as
long as focus is on the <button>
or within
the revealed content.
popups will auto-close if focus leaves the popup.
Info
and indigestion (due to natural digestive enzymes papain and chymopapain). But papaya is not only helpful for the digestive system; a high water content of between 80 and 85% makes it a good diuretic, and it is packed with vitamins A and C, which can boost the body’s immune system and improve skin health.
Info
and indigestion (due to natural digestive enzymes papain and chymopapain). But papaya is not only helpful for the digestive system; a high water content of between 80 and 85% makes it a good diuretic, and it is packed with vitamins A and C, which can boost the body’s immune system and improve skin health.
Info
and indigestion (due to natural digestive enzymes papain and chymopapain). But papaya is not only helpful for the digestive system; a high water content of between 80 and 85% makes it a good diuretic, and it is packed with vitamins A and C, which can boost the body’s immune system and improve skin health.
Our growing season
Fruit
wertewewewe werwwerw Available June – April
werwew Available June – April
werwer Available June – April
werwerewrwer Available June – April
Although the papaya’s exact country of origin is unknown, everything points to it being a native of southern Mexico and Central America. The first European to encounter the papaya was probably Hernán Cortés, when the fruit was included in a banquet offered to him by the Aztecs. Following the Conquests the Spanish spread papaya first to the Caribbean, then the Philippines and Asia. European colonists had introduced it to Africa and the Old World by the mid-17th century.
The fruit grows on a tree which can reach up to ten metres in height, with a hollow trunk and no branches; its thick crown is formed only by leaves stemming from the trunk. All papayas grow and hang from leaf axils – the places along the trunk where leaves also develop. Types of papaya vary; some are large and elongated, others are smaller and resemble a flattened pear in shape.
Christopher Columbus translated papaya’s Carib name ababi as “fruit of the angels”, and considered it a remedy for constipation and indigestion (due to natural digestive enzymes papain and chymopapain). But papaya is not only helpful for the digestive system; a high water content of between 80 and 85% makes it a good diuretic, and it is packed with vitamins A and C, which can boost the body’s immune system and improve skin health.