Class: UiBibz::Ui::Core::Notifications::Tooltip
- Defined in:
- lib/ui_bibz/ui/core/notifications/tooltip.rb
Overview
Create a tooltip
This element is an extend of UiBibz::Ui::Core::Component.
Attributes
-
content- Content of element -
options- Options of element -
html_options- Html Options of element
Options
You can add HTML attributes using the html_options. You can pass arguments in options attribute:
Signatures
UiBibz::Ui::Core::Notifications::Tooltip.new(content, = nil, = nil)
UiBibz::Ui::Core::Notifications::Tooltip.new( = nil, = nil) do
content
end
Examples
UiBibz::Ui::Core::Notifications::Tooltip.new("My content")
# or
UiBibz::Ui::Core::Notifications::Tooltip.new(position: :right) do
content
end
Helper
tooltip = UiBibz::Ui::Core::Notifications::Tooltip.new("My content", position: :left)
ui_glyph("diamond", tooltip: tooltip)
# or
ui_glyph("diamond", {tooltip: true}, { title: "My content" })
# or
ui_glyph("diamond", tooltip: { title: "My content", position: :right})
Constant Summary collapse
- DATA_ATTRIBUTES =
Note that for security reasons the sanitize, sanitizeFn, and allowList options cannot be supplied using data attributes. getbootstrap.com/docs/5.0/components/tooltips/#options
%i[animation container delay html selector template trigger fallbackPlacement boundary].freeze
Constants inherited from Component
Component::BREAKPOINTS, Component::SIZES, Component::STATUSES
Instance Attribute Summary
Attributes inherited from Component
#content, #html_options, #options
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(content = nil, options = nil, html_options = nil, &block) ⇒ Tooltip
constructor
See UiBibz::Ui::Core::Component.initialize.
-
#render ⇒ Object
Render html tag.
Methods inherited from Component
Methods included from PopoverExtension
#popover_data_html, #tooltip_data_html
Methods included from GlyphExtension
#generate_glyph, #glyph_and_content_html
Methods included from KlassExtension
#exclude_classes, #exclude_classes_in_html_options, #join_classes, #status
Methods inherited from Base
#generate_id, #i18n_set?, #inject_url
Constructor Details
#initialize(content = nil, options = nil, html_options = nil, &block) ⇒ Tooltip
See UiBibz::Ui::Core::Component.initialize
60 61 62 63 |
# File 'lib/ui_bibz/ui/core/notifications/tooltip.rb', line 60 def initialize(content = nil, = nil, = nil, &block) super @content = @options[:title] if content.is_a?(Hash) && block.nil? end |
Instance Method Details
#render ⇒ Object
Render html tag
66 67 68 |
# File 'lib/ui_bibz/ui/core/notifications/tooltip.rb', line 66 def render base_attributes.merge(data_attributes) end |