Если кто-то сталкивается с той же проблемой, ниже мое решение.
app.clientside_callback(
"""
function placeholder(n_clicks, data) {
window.data_to_copy = data.data;
var copyText = document.getElementById("text_input");
copyText.select();
copyText.setSelectionRange(0, 99999);
document.execCommand("copy");
}
// Overwrite what is being copied to the clipboard.
document.addEventListener('copy', function(e){
// e.clipboardData is initially empty, but we can set it to the
// data that we want copied onto the clipboard.
e.clipboardData.setData('text/plain', window.data_to_copy);
// This is necessary to prevent the current document selection from
// being written to the clipboard.
e.preventDefault();
});
""",
[Output("copy_output", "children")],
[Input("copy_button", "n_clicks")],
[State("excel_output", "data")]
)