Sha256: 870d5f35df73f82c2e869ad79f09ec787dcd9aef126a18ab9dbb6adf93a8f6ec
Contents?: true
Size: 604 Bytes
Versions: 14
Compression:
Stored size: 604 Bytes
Contents
module Coco class PagerLink < Coco::Component include Concerns::AcceptsOptions tag_name :a tag_attr :href, :target accepts_option :direction, from: %i[previous next], required: true renders_one :icon, ->(name, **kwargs) do Coco::Icon.new(**kwargs, name: name, size: :xxl) end before_render do unless icon? with_icon(next? ? :chevron_right : :chevron_left) end end def direction get_option_value(:direction) end def next? direction == :next end def previous? direction == :previous end end end
Version data entries
14 entries across 14 versions & 1 rubygems