Class: ShadcnPhlexcomponents::SheetTitle

Inherits:
Base
  • Object
show all
Defined in:
lib/shadcn_phlexcomponents/components/sheet.rb

Constant Summary

Constants inherited from Base

Base::SANITIZER_ALLOWED_ATTRIBUTES, Base::SANITIZER_ALLOWED_TAGS, Base::TAILWIND_MERGER

Instance Method Summary collapse

Methods inherited from Base

#before_template, #convert_collection_hash_to_struct, #find_as_child, #icon, #item_disabled?, #merge_default_attributes, #merged_as_child_attributes, #nokogiri_attributes_to_hash, #overlay, #sanitize_as_child

Constructor Details

#initialize(aria_id: nil, **attributes) ⇒ SheetTitle

Returns a new instance of SheetTitle.



196
197
198
199
# File 'lib/shadcn_phlexcomponents/components/sheet.rb', line 196

def initialize(aria_id: nil, **attributes)
  @aria_id = aria_id
  super(**attributes)
end

Instance Method Details

#default_attributes ⇒ Object



201
202
203
204
205
# File 'lib/shadcn_phlexcomponents/components/sheet.rb', line 201

def default_attributes
  {
    id: "#{@aria_id}-title",
  }
end

#view_template ⇒ Object



207
208
209
# File 'lib/shadcn_phlexcomponents/components/sheet.rb', line 207

def view_template(&)
  h2(**@attributes, &)
end