Class: JetUi::Tabs::Component
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- JetUi::Tabs::Component
- Defined in:
- app/components/jet_ui/tabs/component.rb
Constant Summary collapse
- VARIANTS =
%i[pill underline].freeze
- DEFAULT_VARIANT =
:pill
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(variant: DEFAULT_VARIANT, **options) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(variant: DEFAULT_VARIANT, **options) ⇒ Component
Returns a new instance of Component.
9 10 11 12 |
# File 'app/components/jet_ui/tabs/component.rb', line 9 def initialize(variant: DEFAULT_VARIANT, **) @variant = VARIANTS.include?(variant) ? variant : DEFAULT_VARIANT @options = end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 |
# File 'app/components/jet_ui/tabs/component.rb', line 14 def call content_tag :div, class: wrapper_classes do content_tag :ul, content, class: class_names('tabs__list', @options.delete(:class)) end end |