Sha256: ea7fa15ef5024890f186c37d0c5651e930b08fda25ad27eb293d03f2af181b31
Contents?: true
Size: 705 Bytes
Versions: 48
Compression:
Stored size: 705 Bytes
Contents
module Coco module App module Elements class Toast < Coco::Component include Concerns::WrapsComponent include Concerns::ActsAsNotification accepts_option :dismissable, from: [true, false], default: true accepts_option :dismiss, from: [true, false], default: false wraps_component :alert do |args| Coco::App::Elements::Alert.new(**args, dismissable: get_option_value(:dismissable)) end %i[title action secondary_action link].each do |slot_name| renders_one slot_name, ->(**kwargs, &block) do alert.send("with_#{slot_name}".to_sym, **kwargs, &block) end end end end end end
Version data entries
48 entries across 48 versions & 1 rubygems