Class: Shadcn::ResizableHandleComponent

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

Overview

Draggable handle between resizable panels

Constant Summary collapse

HORIZONTAL_CLASSES =
"w-px bg-border cursor-col-resize hover:bg-primary/50 transition-colors"
VERTICAL_CLASSES =
"h-px bg-border cursor-row-resize hover:bg-primary/50 transition-colors"

Instance Attribute Summary

Attributes inherited from BaseComponent

#class_name, #data, #html_options

Instance Method Summary collapse

Methods inherited from BaseComponent

#content

Methods included from Shadcn::Rails::Helpers::ClassNameHelper

#cn

Constructor Details

#initialize(with_handle: false, direction: :horizontal, **options) ⇒ ResizableHandleComponent

Returns a new instance of ResizableHandleComponent.

Parameters:

  • with_handle (Boolean) (defaults to: false)

    Whether to show a visual handle indicator

  • direction (Symbol) (defaults to: :horizontal)

    Direction passed from parent group



11
12
13
14
15
# File 'app/components/shadcn/resizable_handle_component.rb', line 11

def initialize(with_handle: false, direction: :horizontal, **options)
  super(**options)
  @with_handle = with_handle
  @direction = direction
end

Instance Method Details

#callObject



17
18
19
# File 'app/components/shadcn/resizable_handle_component.rb', line 17

def call
  (:div, handle_content, handle_attributes)
end