<stellar-button-copy
code="return "hello""
tooltip-label="Copied to clipboard"
>
</stellar-button-copy>
Props
| Prop | Type | Default | Notes |
code | string | '' | |
disabled | boolean | false | |
tone | neutral | primary | secondary | tertiary | error | neutral | |
appearance | solid | outline | dash | soft | ghost | link | ghost | |
size | xs | sm | md | lg | xl | md | |
shape | '' | square | circle | square | |
width | '' | wide | full | '' | |
icon | string | mdi:content-copy | |
delay | number | 2000 | |
tooltip-label | string | Copy code | |
Events
| Event | Source | Notes |
| custom events | none | stellar-button-copy uses Datastar's built-in @clipboard(...) action and does not emit custom events. |
|---|
Slots
| Slot | Notes |
icon | Optional icon override for the button face. Falls back to the icon prop or the copied check icon. |
|---|
tooltip | Optional tooltip override shown during the copied delay window. Falls back to tooltip-label. |
|---|
Notes
- `stellar-button-copy` is the shared clipboard control used by docs markup cards and other utility surfaces.
- It now delegates its visible button treatment to `stellar-button` instead of carrying a separate visual button implementation.
- It uses Datastar Pro's built-in `@clipboard(...)` action for the actual clipboard write.
- `tooltip-label` drives the visible tooltip bubble shown during the copied delay window.
- The button accessibility name stays a fixed `copy`.
- `disabled` is explicit so callers can turn the control off without also clearing the clipboard payload.
- `tone`, `appearance`, `size`, `shape`, and `width` pass through directly to the inner `stellar-button`.
- `icon` and `tooltip` slots let callers replace the default icon and copied-state tooltip content without giving up the simple prop API.
- `delay` is in milliseconds and clamps at zero, so callers can shorten or effectively disable the copied linger time.