Sha256: 77ff7aad00816b13187c7a615492f376eb749fa8fa1cf2cd412369d89237df9d
Contents?: true
Size: 1.24 KB
Versions: 18
Compression:
Stored size: 1.24 KB
Contents
# frozen_string_literal: true module Primer module Beta # @label ClipboardCopy class ClipboardCopyPreview < ViewComponent::Preview # @label Playground # # @param aria_label [String] # @param value [String] def playground(value: "Text to copy", aria_label: "Copy text to the system clipboard") render(Primer::Beta::ClipboardCopy.new(value: value, "aria-label": aria_label)) end # @label Default Options # # @param aria_label [String] # @param value [String] def default(value: "Text to copy", aria_label: "Copy text to the system clipboard") render(Primer::Beta::ClipboardCopy.new(value: value, "aria-label": aria_label)) end # @label With text instead of icons # # @param aria_label [String] # @param value [String] def text(value: "Text to copy", aria_label: "Click to copy!") render(Primer::Beta::ClipboardCopy.new(value: value, "aria-label": aria_label)) { "Click to copy!" } end # @label Copying from an element # # @param aria_label [String] def element(aria_label: "Copy text to the system clipboard") render_with_template(locals: { aria_label: aria_label }) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems