# JavaScript Components This document details the format for JavaScript components in BookStack. #### Defining a Component in JS ```js class Dropdown { setup() { } } ``` #### Using a Component in HTML A component is used like so: ```html
``` The names will be parsed and new component instance will be created if a matching name is found in the `components/index.js` componentMapping. #### Element References Within a component you'll often need to refer to other element instances. This can be done like so: ```html