Skip to content

feat: add copy to clipboard as valid type to button-group#4729

Draft
shannenigans wants to merge 1 commit into
cloudscape-design:mainfrom
shannenigans:main
Draft

feat: add copy to clipboard as valid type to button-group#4729
shannenigans wants to merge 1 commit into
cloudscape-design:mainfrom
shannenigans:main

Conversation

@shannenigans

@shannenigans shannenigans commented Jul 15, 2026

Copy link
Copy Markdown

Description

Add icon-copy-to-clipboard as a valid item type in the ButtonGroup component. This
allows users to embed a copy-to-clipboard action directly within a button group
alongside existing item types (icon-button, icon-toggle-button, icon-file-input,
menu-dropdown).

Changes:

  • Added IconCopyToClipboard interface with properties: id, text, textToCopy,
    copySuccessText, copyErrorText, disabled, and disabledReason
  • Added onCopySuccess and onCopyFailure event handlers to ButtonGroupProps
  • Created CopyToClipboardItem component that wraps InternalCopyToClipboard with
    tooltip support
  • Updated ItemRuntime, Item, and InternalItem union types to include the new
    item type
  • Wired up copy event handlers through internal.tsx and item-element.tsx

Related links, issue #, if available: n/a

How has this been tested?

  • Verified TypeScript compilation with the new type additions
  • Manually tested rendering a button group with an icon-copy-to-clipboard item
  • Confirmed copy success/failure callbacks fire correctly
  • Confirmed tooltip behavior matches other button group item types
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see [CONTRIBUTING.md](https://
    github.com/cloudscape-design/components/blob/main/CONTRIBUTING.md#public-apis).
  • Changes do not include unsupported browser features, see
    [CONTRIBUTING.md](https://github.com/cloudscape-design/components/blob/main/CONTRIB
    UTING.md#browsers-support).
  • Changes were manually tested for accessibility, see accessibility
    guidelines
    .

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and
redistribute this contribution, under the terms of your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant