Popover
UiBibz::Ui::Core::Notifications::Popover
Documentation and examples for adding custom Bootstrap popovers with CSS and JavaScript using CSS3 for animations and data-bs-attributes for local title storage
Usage
This component is an extension of component element. A Ui Bibz component consists of 3 arguments:
# by variable
popover content, options, html_options
# or by block
popover options, html_options do
content
end
Note that for security reasons the sanitize
, sanitizeFn
, and allowList
options cannot be supplied using data attributes.
Examples
Some examples explain how to use the options present in the component.Options by Object
popover = UiBibz::Ui::Core::Notifications::Popover.new('My popover', position: :right)
ui_glyph "gem", popover: popover
<i data-bs-toggle="popover" data-bs-title="My popover" data-bs-placement="right" class="glyph fas fa-gem" data-bs-original-title="" title=""></i>
Options by Hash
ui_button "My button", popover: { content: 'My popover', title: 'My title' position: :top}, status: :primary
<button data-bs-toggle="popover" data-bs-title="My popover" data-bs-placement="right" class="btn-primary btn" data-bs-original-title="" title="">My button</button>
Options by String
To replace title notification by popover notification
My badge
ui_badge "My badge", type: :pill, popover: 'My popover', status: :danger
<span data-bs-toggle="popover" data-bs-title="My popover" class="bg-danger badge rounded-pill" data-bs-original-title="" title="">My badge</span>