Class: Primer::Beta::ClipboardCopyButton

Inherits:
Button
  • Object
show all
Defined in:
app/components/primer/beta/clipboard_copy_button.rb

Overview

‘ClipboardCopyButton` uses the `ClipboardCopy` component to copy text to the clipboard, styled as a Primer button. It can be used wherever a button is desired, and works well with components like `ButtonGroup`.

Constant Summary

Constants inherited from Button

Button::ALIGN_CONTENT_MAPPINGS, Button::ALIGN_CONTENT_OPTIONS, Button::DEFAULT_ALIGN_CONTENT, Button::DEFAULT_SCHEME, Button::DEFAULT_SIZE, Button::SCHEME_MAPPINGS, Button::SCHEME_OPTIONS, Button::SIZE_MAPPINGS, Button::SIZE_OPTIONS

Constants inherited from Component

Component::INVALID_ARIA_LABEL_TAGS

Constants included from Status::Dsl

Status::Dsl::STATUSES

Constants included from ViewHelper

ViewHelper::HELPERS

Constants included from TestSelectorHelper

TestSelectorHelper::TEST_SELECTOR_TAG

Constants included from FetchOrFallbackHelper

FetchOrFallbackHelper::InvalidValueError

Constants included from AttributesHelper

AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES

Instance Method Summary collapse

Methods inherited from Component

deprecated?, generate_id

Methods included from JoinStyleArgumentsHelper

#join_style_arguments

Methods included from TestSelectorHelper

#add_test_selector

Methods included from FetchOrFallbackHelper

#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?

Methods included from ClassNameHelper

#class_names

Methods included from AttributesHelper

#aria, #data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes

Constructor Details

#initialize(**system_arguments) ⇒ ClipboardCopyButton

Returns a new instance of ClipboardCopyButton.

Parameters:

  • system_arguments (Hash)

    The arguments accepted by <%= link_to_component(Primer::Beta::Button) %> and <%= link_to_component(Primer::Beta::ClipboardCopy) %>.



10
11
12
# File 'app/components/primer/beta/clipboard_copy_button.rb', line 10

def initialize(**system_arguments)
  super(**system_arguments, base_button_class: ClipboardCopyBaseButton)
end