Skip to content
Hazine

Copy and share actions

1 of 5 shipped. Each take is a different structure, and the note under its title says how.

  • copy and share actions

    The smallest copy primitive: one icon or icon plus label button with idle, copied and failed states, a stable name and feedback through a status region.

    shadcn add @hazine/copy-button

    Depends on button, lucide-react

Planned 4

  • Read-Only Copy Field

    Value is visible and selectable in an input with an attached button segment, so users can read and verify before copying; middle truncation is visual only and the confirmation appears inline under the field.

  • Inline Click to Copy Value

    No button chrome: the value itself is the target, rendered inline in monospace with tabular numbers so it flows with surrounding text; a copy icon fades in on hover and focus without shifting layout, an optional display formatter groups long values while the raw string is copied, and the target is padded to 24px height without changing line height.

  • Share Menu

    Feature-detects navigator.share and falls back to a popover with a copy row on top and destination links below; destinations are real anchors opening in a new tab with that fact stated in their accessible names.

  • Share Link with Expiry

    Stateful link lifecycle in one card: no link, active link with a relative expiry line ("Expires in 6 days"), and revoked; changing access or expiry calls an async callback and regenerating warns inline that the old link stops working.