본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Html

원문 보기 위키 갱신

클립보드 복사(Clipboard copy) HTML 컴포넌트는 텍스트를 클립보드로 복사하고 확장 가능한 콘텐츠를 보여주는 패턴이에요. 이 페이지에서는 HTML/CSS 기반 구현과 접근성, 사용 지침을 다뤄요.

출처: 문서

본문

Examples

Basic

Expandable

Editable

[

  

]

This is an editable version of the copy to clipboard component that has an expandable section. Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting expansion.

[

  

]

This is an editable version of the copy to clipboard component that has an expandable section. Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting expansion.

Read-only

[

  

]

This is an editable version of the copy to clipboard component that has an expandable section. Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting expansion.

[

  

]

This is a read-only version of the copy to clipboard component that has an expandable section. Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting expansion.

Code

[

  

]

[

```

{ "menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }}

  
[

    
    [
    
      
    
    ]
    
  

  
[

    ```
{ "menu": {
    "id": "file",
    "value": "File",
    "popup": {
      "menuitem": [
        {"value": "New", "onclick": "CreateNewDoc()"},
        {"value": "Open", "onclick": "OpenDoc()"},
        {"value": "Close", "onclick": "CloseDoc()"}
      ]
    }
  }}

Inline compact

2.3.4-2-redhat

Inline compact code

2.3.4-2-redhat

Inline compact with additional action

2.3.4-2-redhat

Inline compact in sentence

Basic Lorem ipsum

2.3.4-2-redhat

dolor sit amet.

Long copy string Lorem ipsum dolor sit amet, consectetur adipiscing elit.

https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890

Mauris luctus, libero nec dapibus ultricies, urna purus pretium mauris, ullamcorper pharetra lacus nibh vitae enim.

Long copy string in block Lorem ipsum dolor sit amet, consectetur adipiscing elit.

https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890

Mauris luctus, libero nec dapibus ultricies, urna purus pretium mauris, ullamcorper pharetra lacus nibh vitae enim.

Inline compact with truncation

  This lengthy, copyable content will be truncated with default settings when the truncation prop is simply set to true. This is useful for quickly applying truncation without needing to worry about any other properties to set.

Documentation

Accessibility

| | Attribute | Applied to | Outcome

| aria-label="Copy to clipboard", aria-label="Show content" | | .pf-v6-c-button.pf-m-control | | Provides an accessible name for the button when an icon is used instead of text. Required when an icon is used with no supporting text. | | aria-label="[input label text]" | | .pf-v6-c-form-control | | Provides an accessible label for the input. Provide a label that describes the contents in the input. Required | | aria-hidden="true" | | | | Hides the icon from assistive technologies. | | `aria-controls="[id of expandable element]"` | | `.pf-v6-c-button.pf-m-control` | | Identifies the element controlled by the toggle button. Required | | `hidden` | | `.pf-v6-c-clipboard-copy__expandable-content` | | Indicates that the expandable content is hidden so that it isn't visible in the UI and isn't accessed by assistive technologies. | | `aria-labelledby="[id of button] [id of input label]"` | | `.pf-v6-c-button.pf-m-control` | | Provides an accessible name that is unique and communicates context of the button. Required when more than one ClipboardCopy component exists on the page. Important: If the label is defined on the using aria-label, then use the id of the . If the label is defined in a , then use the id of the ``. Alternatively this attribute can be ignored if the text input label is defined as part of the value in aria-label. |

Usage

| | Class | Applied to | Outcome

| .pf-v6-c-clipboard-copy | | | | Initiates a clipboard copy component. Required | | `.pf-v6-c-clipboard-copy__group` | | | | Initiates a wrapper for the clipboard copy group. Required | | .pf-v6-c-clipboard-copy__toggle-icon | | | | Initiates a toggle button icon. | | `.pf-v6-c-clipboard-copy__expandable-content` | | | | Initiates an expandable element. | | .pf-v6-c-clipboard-copy__text | | | | Initiates the inline copy clipboard text element. Required | | `.pf-v6-c-clipboard-copy__actions` | | | | Initiates the inline copy clipboard actions element. Required | | .pf-v6-c-clipboard-copy__actions-item | | | | Initiates the inline copy clipboard actions item element. Required | | `.pf-m-inline` | | `.pf-v6-c-clipboard-copy` | | Modifies the clipboard copy component for inline styles. | | `.pf-m-block` | | `.pf-v6-c-clipboard-copy.pf-m-inline` | | Modifies the inline copy clipboard component to have block formatting. | | `.pf-m-truncate` | | `.pf-v6-c-clipboard-copy.pf-m-truncate` | | Modifies the inline copy clipboard component for use with text used in trucate component. | | `.pf-m-expanded` | | `.pf-v6-c-clipboard-copy` | | Modifies the clipboard copy component for the expanded state. | | `.pf-m-readonly` | | `.pf-v6-c-clipboard-copy` | | Modifies the clipboard copy component for read-only styles. | | `.pf-m-expanded` | | `.pf-v6-c-button.pf-m-control` | | Modifies the control toggle button for the expanded state. | | `.pf-m-code` | | `code.pf-v6-c-clipboard-copy__text` | | Modifies the inline copy clipboard text styles for use with the element. |

Edit this page on GitHub

더 알아보기 (Learn more)