- What is a modular approach?
- The functionality is broken down into individual components, files. There is no one file approach as it was with Bootstrap in Joomla 3. This was done for efficiency and performance gains (send only the code that is needed instead of delivering everything in case some page will need so component).
- Load what you need per case! There are helper functions that will help you achieve this and, it is dead easy just call the function with the appropriate arguments.
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.alert', '.selector');- The
.selectorrefers to the CSS selector for the alert. You can call this function multiple times with different CSS selectors - No extra options available
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.button', '.selector');- The
.selectorrefers to the CSS selector for the button. You can call this function multiple times with different CSS selectors - No extra options available
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.carousel', '.selector', []);- The
.selectorrefers to the CSS selector for the carousel. You can call this function multiple times with different CSS selectors - The third argument refers to the options available for carousel
Options for the carousel can be:
interval, number, default:5000, The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.keyboard, boolean, default:trueWhether the carousel should react to keyboard events.pause, string|boolean,hoverPauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave.slide, string|boolean, default:falseAutoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.collapse', '.selector', []);- The
.selectorrefers to the CSS selector for the collapse. You can call this function multiple times with different CSS selectors - The third argument refers to the options available for collapse
Options for the collapse can be:
parent, string, default:falseIf parent is provided, then all collapsible elements under the specified parent will be closed when this collapsible item is shown.toggle, boolean default:trueToggles the collapsible element on invocation
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.dropdown', '.selector', []);- The
.selectorrefers to the CSS selector for the dropdown. You can call this function multiple times with different CSS selectors - The third argument refers to the options available for dropdown
Options for the collapse can be:
flip, boolean, default:trueAllow Dropdown to flip in case of an overlapping on the reference elementboundary, string, default:scrollParentOverflow constraint boundary of the dropdown menureference, string, default:toggleReference element of the dropdown menu. Acceptstoggleorparentdisplay, string, default:dynamicBy default, we use Popper for dynamic positioning. Disable this withstatic
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.modal', '.selector', []);- The
.selectorrefers to the CSS selector for the modal. You can call this function multiple times with different CSS selectors - The third argument refers to the options available for modal
Options for the modal can be:
backdrop, string|boolean default:trueIncludes a modal-backdrop element. Alternatively, specify static for a backdrop which doesn't close the modal on click.keyboard, boolean default:trueCloses the modal when escape key is pressedfocus, boolean default:trueCloses the modal when escape key is pressed
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.offcanvas', '.selector', []);- The
.selectorrefers to the CSS selector for the offcanvas. You can call this function multiple times with different CSS selectors - The third argument refers to the options available for offcanvas
Options for the offcanvas can be:
backdrop, boolean, default:trueApply a backdrop on body while offcanvas is openkeyboard, boolean, default:trueCloses the offcanvas when escape key is pressedscroll, boolean, default:falseAllow body scrolling while offcanvas is open
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.popover', '.selector', []);- The
.selectorrefers to the CSS selector for the popover. You can call this function multiple times with different CSS selectors - The third argument refers to the options available for popover
Options for the popover can be:
animation, boolean, default:trueApply a CSS fade transition to the popovercontainer, string|boolean, default:falseAppends the popover to a specific element. Eg.:bodycontent, string, default:nullDefault content value if data-bs-content attribute isn't presentdelay, number, default:0Delay showing and hiding the popover (ms) does not apply to manual trigger typehtml, boolean, default:trueInsert HTML into the popover. Iffalse, innerText property will be used to insert content into the DOM.placement, string, default:rightHow to position the popover -auto|top|bottom|left|right. When auto is specified, it will dynamically reorient the popoverselector, string, default:falseIf a selector is provided, popover objects will be delegated to the specified targets.template, string, default:nullBase HTML to use when creating the popover.title, string, default:nullDefault title value iftitletag isn't presenttrigger, string, default:clickHow popover is triggered -click|hover|focus|manualoffset, integer, default:0Offset of the popover relative to its target.
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.scrollspy', '.selector', []);- The
.selectorrefers to the CSS selector for the scrollspy. You can call this function multiple times with different CSS selectors - The third argument refers to the options available for scrollspy
Options for the Scrollspy can be:
offsetnumber Pixels to offset from top when calculating position of scroll.methodstring Finds which section the spied element is in.targetstring Specifies element to apply Scrollspy plugin.
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tabs', '.selector', []);- The
.selectorrefers to the CSS selector for the tab. You can call this function multiple times with different CSS selectors - The third argument refers to the options available for tab
Options for the Tab can be:
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip', '.selector', []);- The
.selectorrefers to the CSS selector for the tooltip. You can call this function multiple times with different CSS selectors - The third argument refers to the options available for tooltip
Options for the tooltip can be:
animation, boolean apply a css fade transition to the popovercontainer, string|boolean Appends the popover to a specific element: { container:body}delay, number|object delay showing and hiding the popover (ms) - does not apply to manual trigger type If a number is supplied, delay is applied to both hide/show Object structure is: delay: { show: 500, hide: 100 }html, boolean Insert HTML into the popover. If false, jQuery's text method will be used to insert content into the dom.placement, string|function how to position the popover -top|bottom|left|rightselectorstring If a selector is provided, popover objects will be delegated to the specified targets.template, string Base HTML to use when creating the popover.title, string|function default title value iftitletag isn't presenttrigger, string how popover is triggered - hover | focus | manualconstraints, array An array of constraints - passed through to Popper.offset, string Offset of the popover relative to its target.
Assuming you have the HTML part already in your Layout, you will also need to include the interactivity (the javascript part):
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.toast', '.selector', []);- The
.selectorrefers to the CSS selector for the toast. You can call this function multiple times with different CSS selectors - The third argument refers to the options available for toast
Options for the toast can be:
animation, boolean, deafult:trueApply a CSS fade transition to the toastautohide, boolean, deafult:trueAuto hide the toastdelay, number , deafult:5000Delay hiding the toast (ms)
Thank you!