Class: PhlexKit::TabsContent
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::TabsContent
- Defined in:
- app/components/phlex_kit/tabs/tabs_content.rb
Instance Method Summary collapse
-
#initialize(value:, **attrs) ⇒ TabsContent
constructor
A new instance of TabsContent.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(value:, **attrs) ⇒ TabsContent
Returns a new instance of TabsContent.
3 4 5 6 |
# File 'app/components/phlex_kit/tabs/tabs_content.rb', line 3 def initialize(value:, **attrs) @value = value @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
7 8 9 10 11 12 |
# File 'app/components/phlex_kit/tabs/tabs_content.rb', line 7 def view_template(&) # id / aria-labelledby mirror TabsTrigger's deterministic ids (re-scoped # per instance by the controller); tabindex="0" makes the panel itself # focusable, per the APG tabs pattern. div(**mix({ class: "pk-tabs-content pk-hidden", role: "tabpanel", id: "pk-tabs-panel-#{@value}", aria_labelledby: "pk-tabs-trigger-#{@value}", tabindex: "0", data: { phlex_kit__tabs_target: "content", value: @value } }, @attrs), &) end |