Class: SidebarComponent

Inherits:
Component show all
Defined in:
app/components/sidebar_component.rb

Overview

Sidebar — slide-out sidebar navigation.

Usage:

Sidebar(direction: :left, visible: true, inverted: true) {
  MenuItem(href: "#") { text "Home" }
  MenuItem(href: "#") { text "Settings" }
}

Constant Summary

Constants inherited from Component

Component::HTML_OPTIONS

Instance Method Summary collapse

Methods inherited from Component

default, #initialize, #render_in, slot

Constructor Details

This class inherits a constructor from Component

Instance Method Details

#to_sObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/components/sidebar_component.rb', line 19

def to_s
  classes = class_names(
    "ui",
    direction,
    width,
    { "inverted" => inverted,
      "vertical" => vertical,
      "visible" => visible },
    "sidebar",
    "menu"
  )

  tag.div(class: classes, data: { controller: "fui-sidebar", fui_sidebar_transition_value: transition }) { @content }
end