Class: Flowbite::Toast::CloseButton
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Flowbite::Toast::CloseButton
- Defined in:
- app/components/flowbite/toast/close_button.rb
Overview
Renders the close button of a toast notification.
Class Method Summary collapse
-
.classes ⇒ Object
Styles from https://flowbite.com/docs/components/toast/#default-toast rubocop:disable Layout/LineLength.
Instance Method Summary collapse
- #button_options ⇒ Object
-
#initialize(**options) ⇒ CloseButton
constructor
A new instance of CloseButton.
Constructor Details
#initialize(**options) ⇒ CloseButton
Returns a new instance of CloseButton.
19 20 21 |
# File 'app/components/flowbite/toast/close_button.rb', line 19 def initialize(**) @options = || {} end |
Class Method Details
.classes ⇒ Object
Styles from https://flowbite.com/docs/components/toast/#default-toast rubocop:disable Layout/LineLength
13 14 15 |
# File 'app/components/flowbite/toast/close_button.rb', line 13 def classes ["ms-auto", "flex", "items-center", "justify-center", "text-body", "hover:text-heading", "bg-transparent", "box-border", "border", "border-transparent", "hover:bg-neutral-secondary-medium", "focus:ring-4", "focus:ring-neutral-tertiary", "font-medium", "leading-5", "rounded", "text-sm", "h-8", "w-8", "focus:outline-none"] end |
Instance Method Details
#button_options ⇒ Object
23 24 25 26 27 28 29 |
# File 'app/components/flowbite/toast/close_button.rb', line 23 def { aria: {label: "Close"}, class: self.class.classes, type: "button" }.merge(@options) end |