Class: UI::TabsList

Inherits:
Phlex::HTML
  • Object
show all
Includes:
TabsListBehavior
Defined in:
app/components/ui/tabs_list.rb

Overview

TabsList component (Phlex) Container for tab trigger buttons

Examples:

Basic usage

render UI::List.new do
  render UI::Trigger.new(value: "tab1") { "Tab 1" }
  render UI::Trigger.new(value: "tab2") { "Tab 2" }
end

Instance Method Summary collapse

Methods included from TabsListBehavior

#list_html_attributes

Constructor Details

#initialize(orientation: "horizontal", classes: "", attributes: {}) ⇒ TabsList

Returns a new instance of TabsList.

Parameters:

  • orientation (String) (defaults to: "horizontal")

    “horizontal” or “vertical”

  • classes (String) (defaults to: "")

    additional CSS classes

  • attributes (Hash) (defaults to: {})

    additional HTML attributes



17
18
19
20
21
22
# File 'app/components/ui/tabs_list.rb', line 17

def initialize(orientation: "horizontal", classes: "", attributes: {}, **)
  @orientation = orientation
  @classes = classes
  @attributes = attributes
  super()
end

Instance Method Details

#view_template(&block) ⇒ Object



24
25
26
# File 'app/components/ui/tabs_list.rb', line 24

def view_template(&block)
  div(**list_html_attributes, &block)
end