Styling contract
Wrapper slot hooks
Wrapper state attributes
Owner guidance
Target the rendered button inside tng-copy-button when you need custom stateful styling. Keep the live region hidden, and prefer wrapper-level containers for layout and spacing rather than overriding the component’s internal flex alignment.
copybutton.contract.css
css
tng-copy-button > .tng-copy-button[data-appearance="solid"] {
background: var(--tng-semantic-accent-brand);
color: var(--tng-color-white);
}
tng-copy-button > .tng-copy-button[data-state="copied"] {
background: var(--tng-semantic-accent-success);
border-color: transparent;
}
tng-copy-button > .tng-copy-button[data-state="error"] {
background: var(--tng-semantic-accent-danger);
border-color: transparent;
}