Class: Shadcn::PaginationItemComponent

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

Overview

Pagination Item component - wrapper for links

Constant Summary collapse

"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-9 w-9"
ACTIVE_CLASSES =
"border border-input bg-background shadow-sm"

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(href: nil, active: false, disabled: false, **options) ⇒ PaginationItemComponent

Returns a new instance of PaginationItemComponent.



9
10
11
12
13
14
# File 'app/components/shadcn/pagination_item_component.rb', line 9

def initialize(href: nil, active: false, disabled: false, **options)
  super(**options)
  @href = href
  @active = active
  @disabled = disabled
end

Instance Method Details

#callObject



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

def call
  (:li) do
    link_element
  end
end