Class: Shadcn::SidebarProviderComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/shadcn/sidebar_provider_component.rb

Overview

SidebarProvider component - wrapper that provides sidebar context and state

Constant Summary collapse

BASE_CLASSES =
"group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar"

Instance Attribute Summary

Attributes inherited from BaseComponent

#class_name, #data, #html_options

Instance Method Summary collapse

Methods inherited from BaseComponent

#content

Methods included from Rails::Helpers::ClassNameHelper

#cn

Constructor Details

#initialize(default_open: true, open: nil, keyboard_shortcut: "b", **options) ⇒ SidebarProviderComponent

Returns a new instance of SidebarProviderComponent.



15
16
17
18
19
20
# File 'app/components/shadcn/sidebar_provider_component.rb', line 15

def initialize(default_open: true, open: nil, keyboard_shortcut: "b", **options)
  super(**options)
  @default_open = default_open
  @open = open
  @keyboard_shortcut = keyboard_shortcut
end

Instance Method Details

#callObject



22
23
24
# File 'app/components/shadcn/sidebar_provider_component.rb', line 22

def call
  (:div, provider_content, provider_attributes)
end