Sha256: 2922f0732f40640fbde10891518afc14d5bbf1aecf2da49b6c6e89bce64c1f5c
Contents?: true
Size: 1.28 KB
Versions: 112
Compression:
Stored size: 1.28 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] # @snapshot 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] # @snapshot 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
112 entries across 112 versions & 2 rubygems