Übersicht FarbenTypografieAbstände & RasterIcons ButtonButton GroupIcon ButtonLink CheckboxCheckbox GroupChipChip GroupComboboxDate PickerFieldField LabelFieldsFile UploadFormForm SectionInputInput GroupOTP InputPasswordRadioRadio GroupRange SliderReset ButtonSave ButtonSearchSegmented ControlSelectSliderSwitchTextareaTime Picker AvatarAvatar GroupBadgeChartCode BlockCopy ValueData TableInline StatKey ValueList GroupList RowsMeta ItemQR CodeStatStat StripTableTag AlertEmpty StateGuideLive StatusMessagesProgressSkeletonToast DialogDrawerDropdownMenuMenu ItemPopoverTooltip BreadcrumbContent NavigationDate NavigationPaginationSidebarStepperTabsTheme SwitchTopbar AccordionAccordion ItemApp ShellCardDividerFooterPage HeaderSection HeaderSplit Panel DashboardListeFormularDetailansichtEinstellungenMehrschritt-AssistentLeerer StartLoginFehlerseite IconsMusterAdmin

Copy Value

Typen

Inline-Wert, Feld für Schlüssel und reiner Icon Button

Code<div class="tc-stack" style="--tc-gap: 16px; max-width: 320px"> <div class="tc-cluster">{% tc_copy_value# value="10.0.4.17" %}{% tc_copy_value# value="vpn.example.com" %}</div> {% tc_copy_value# type="field" value="tc_live_8F3K2xAbCdEfGh" %} <div class="tc-cluster">{% tc_copy_value# type="icon" value="10.0.4.17" label="IP-Adresse kopieren" %}{% tc_copy_value# value="10.0.4.18" disabled %}</div> {% tc_copy_value# type="field" value="Kein Zugriff" disabled %} </div>

In Detailansichten

technische Werte direkt kopieren

Code<div style="max-width: 560px"> {% tc_key_value %} {% tc_key_value_row key="Öffentlicher Schlüssel" %}{% tc_copy_value# value="AbCdEfGhIjKlMnOpQrStUv0=" %}{% endtc_key_value_row %} {% tc_key_value_row key="Endpunkt" %}{% tc_copy_value# value="vpn.example.com:51820" %}{% endtc_key_value_row %} {% endtc_key_value %} </div>

HTML und JS-API

<tc-copy-value> direkt im Markup; copy() und Event tc-copy mit dem kopierten Text.

Code<div class="tc-stack" style="--tc-gap: 12px; max-width: 320px"> <tc-copy-value id="raw-copy" value="10.0.4.19"></tc-copy-value> <tc-copy-value type="field" value="tc_live_…h3Kq" copy-text="tc_live_8F3K2xAbCdEfGh3Kq" label="API-Schlüssel kopieren"></tc-copy-value> <span id="raw-copy-log" class="tc-text-body-sm tc-text-secondary" aria-live="polite"></span> </div> <script> (function () { document.addEventListener('tc-copy', function (event) { var log = document.getElementById('raw-copy-log'); if (log) log.textContent = 'tc-copy: ' + event.detail.text; }); })(); </script>

API

OptionStandardWerteBeschreibung
value''–Text that is shown and copied.
type'inline'Inline, field or icon only.
copy_text''–Copy this text instead of the shown value (e.g. a full token).
label''–Accessible name / tooltip of the copy button; defaults to "Copy".
monoTrue–Mono value.
disabledFalse–Disable copying.

Verwendung

{% load components tomcom_theme %} {% tc_copy_value value="…" type="…" %}…{% endtc_copy_value %} {% tc_copy_value# %} {# inline form without content #}

Zusätzliche Attribute (z. B. class, aria-*, data-*) und HTMX-Kurzformen (get, post, get_url, post_url, target, swap, trigger, confirm) werden an das Element „root“ durchgereicht.