window.DS object to the global scope.
Initialise all components
initAll() to initialise all components on the current page.
If you do not want to initialise components on the whole page, you can specify a container element to initialise components within.
This could be useful when you have loaded new content into a section of the page and need to initialise new DS components in that section.
initAll method will find any elements with a
data-module attribute that corresponds to a Design System component. It will create a new instance of that component and initialise it. For example, this is the markup for a ‘back to top’ component, with its
initAll()also initialises the Design System's analytics tracking script, which adds data attributes to elements that analytics tools can use.
Initialise individual components
window.DS.components. The component classes all have an
init method that is used to initialise the component.
If you wanted to set up some new accordions, for example, you would select the accordion elements and then create a component instance for each and initialise them.
Some Design System components accept additional options when they are instantiated. These are detailed on the documentation page for those components.
This is an example of importing and using the ‘temporary focus’ helper. ‘Temporary focus’ is used for focus management to aid accessibility.
Feedback, help or support
If you need any help or want to give any feedback you can e-mail us at: email@example.com