Disclosure controls the visibility of content in context.
Content inside a disclosure should be hidden if not appropriate to all users or contains additional contextual information relating to a term. An example would be “How is my carbon footprint calculated?”, with a short paragraph relating to details about the calculation method.
Hidden content is easily missed, so essential information should not be placed inside a disclosure.
The Disclosure component will automatically link the component toggle button to the content and set the relevant aria attributes.
Disclosure is an uncontrolled component and manages its own state - the default state can be set with the expanded prop.
A person's carbon footprint is made up of all the carbon that’s released through actions they take and choices they make, in their day-to-day lives.
onToggle(expanded) => null