Sha256: 5a9858cceb39bc79fe381ab11c6d91716dc7af6d1dc72791a809306f4ddaf37b

Contents?: true

Size: 872 Bytes

Versions: 2

Compression:

Stored size: 872 Bytes

Contents

# frozen_string_literal: true

module Yattho
  module Alpha
    # @label ImageCrop
    class ImageCropPreview < ViewComponent::Preview
      # @label Playground
      #
      # @param rounded [Boolean]
      def playground(rounded: false)
        render(Yattho::Alpha::ImageCrop.new(src: Yattho::ExampleImage::BASE64_SRC, rounded: rounded))
      end

      # @label Default Options
      #
      # @param rounded [Boolean]
      def default(rounded: false)
        render(Yattho::Alpha::ImageCrop.new(src: Yattho::ExampleImage::BASE64_SRC, rounded: rounded))
      end

      # @label Custom loading slot
      #
      # @param rounded [Boolean]
      def loading(rounded: false)
        render(Yattho::Alpha::ImageCrop.new(src: Yattho::ExampleImage::BASE64_SRC, rounded: rounded)) do |c|
          c.with_loading { "Loading..." }
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yattho_view_components-0.1.1 previews/yattho/alpha/image_crop_preview.rb
yattho_view_components-0.0.1 previews/yattho/alpha/image_crop_preview.rb