Skip to main content
Version: Next

CopyButton API

import { CopyButton } from '@editora/ui-react';

Props​

PropTypeDescription
animation'scale' | 'pulse' | 'none'
ariaLabelstring
blockboolean
copiedIconReact.ReactNode
copiedLabelReact.ReactNode
disabledboolean
downloadstring | boolean
failedIconReact.ReactNode
failedLabelReact.ReactNode
headlessboolean
hrefstringMakes it a link that looks like a button (a real <a>: new tab, address on hover, announced as a link). Goes through NavigationProvider like Sidebar and Breadcrumb links.
iconstring
iconOnlyboolean
iconPosition'start' | 'end'
labelReact.ReactNode
loadingboolean
loadingLabelstring
onCopy(detail: { value: string; success: boolean }) => void
onNavigate(detail: ComponentNavigateDetail<{ href: string }>) => voidRuns before a link button is followed; detail.preventDefault() keeps the page.
radiusnumber | string
recipe'classic' | 'solid' | 'soft' | 'surface' | 'outline' | 'ghost'
relstring
resetAfternumber
scale'1' | '2' | '3' | '4'
size'sm' | 'md' | 'lg'
state'idle' | 'loading' | 'error' | 'success'
targetstring
theme'default' | 'dark' | 'brand'
tone'neutral' | 'info' | 'success' | 'warning' | 'danger'
type'button' | 'submit' | 'reset'
value (required)string
variantButtonProps['variant'] | 'icon'

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).