page CodeCopyButtoncomponent { seo { title = "CodeCopyButton component" description = "Reusable code copy button component." } view {
W WRNexusJS
actions component

CodeCopyButton

Reusable code copy button component.

@wrnexus/ui 0.2.656 props1 slots0 events

Usage

Components are auto-discovered. Use the component directly in any .wrn view:

<CodeCopyButton label="Action" href="href" type="button" variant="primary" disabled="false" />

Legacy mount name: data-component="CodeCopyButton".

Props and attributes

PropTypeRequirementDefault
labelstringOptional"Action"
hrefstringOptional""
typestringOptional"button"
variantstringOptional"primary"
disabledbooleanOptionalfalse
classstringOptional""

Slots

  • default

Events

This component does not declare a custom event.

Source contract

Installed source: components/CodeCopyButton.wrn

component CodeCopyButton {
  props {
    label = "Action"
    href = ""
    type = "button"
    variant = "primary"
    disabled = false
    class = ""
  }
  view { <span class="wire-catalog-action {class}"><a data-show="href" href="{href}" class="wire-btn wire-btn--{variant}">{label}<slot /></a><button data-show="!href" type="{type}" disabled="{disabled}" class="wire-btn wire-btn--{variant}">{label}<slot /></button></span> }
}
} }