Defining options for interactive components
In the list at the beginning of this chapter, we saw which options were available for interactive components. In the official documentation of Bootstrap 5, you will find a table describing all of the available options (if any) for each component. In this table, you will find the name, type, default value, and description for each option. You can access the components in the official documentation through this link: getbootstrap.com/docs/5.1/components.
Default options for all components of a type and common options for a group of components can be set via JavaScript, while options for individual components can be passed either via data attributes or via JavaScript. Let’s now see how this is done.
Defining default options
You can change the default value for an option for a component by using the following syntax:
JavaScript
bootstrap.[component name].Default.[option name] = [option value];
As an example, we can set...