Class: PhlexKit::Tabs
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Tabs
- Defined in:
- app/components/phlex_kit/tabs/tabs.rb
Overview
Tabbed panels. Ported from ruby_ui's RubyUI::Tabs. Compose Tabs(default:) > (TabsList > TabsTrigger(value:)) + TabsContent(value:). phlex-kit--tabs.
Instance Method Summary collapse
-
#initialize(default: nil, **attrs) ⇒ Tabs
constructor
A new instance of Tabs.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(default: nil, **attrs) ⇒ Tabs
Returns a new instance of Tabs.
5 6 7 8 |
# File 'app/components/phlex_kit/tabs/tabs.rb', line 5 def initialize(default: nil, **attrs) @default = default @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
9 10 11 |
# File 'app/components/phlex_kit/tabs/tabs.rb', line 9 def view_template(&) div(**mix({ class: "pk-tabs", data: { controller: "phlex-kit--tabs", phlex_kit__tabs_active_value: @default } }, @attrs), &) end |