🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@paprika/copy-input

Package Overview
Dependencies
Maintainers
4
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paprika/copy-input

The CopyInput component is an input with a button that copies the input's contents to user's clipboard.

latest
Source
npmnpm
Version
4.0.2
Version published
Weekly downloads
47
-26.56%
Maintainers
4
Weekly downloads
 
Created
Source

@paprika/copy-input

Description

The CopyInput component is an input with a button that copies the input's contents to user's clipboard.

Installation

yarn add @paprika/copy-input

or with npm:

npm install @paprika/copy-input

Props

CopyInput

PropTyperequireddefaultDescription
alterCopiedTextfuncfalsenullCalled after the button is clicked, and the copied value is passed in
childrennodefalsenullUsed for CopyInput.Input
clickedTextstringfalsenullThe text to show in the tooltip when the user presses the "copy" button
hoverTextstringfalsenullThe text to show in the tooltip when the user hovers over the "copy" button
isReadOnlyboolfalsetrueIs the input read-only.
hasInputContainerboolfalsetrueIf the value will be rendered in an Input component or hidden
hasValueContainerboolfalsefalseIf a plain text version of the value will be rendered
valuestringfalse""Default value for the input

Usage

Uncontrolled:

import CopyInput from "@paprika/copy-input";

return <CopyInput value="Copy me" />;

Controlled with props for the internal Input

import CopyInput from "@paprika/copy-input";

const [controlledValue, setControlledValue] = React.useState("Copy me");

return (
  <CopyInput>
    <CopyInput.Input value={controlledValue} onChange={e => setControlledValue(e.target.value)} />
  </CopyInput>
);
  • Storybook Showcase
  • GitHub source code
  • Create GitHub issue
  • CHANGELOG

FAQs

Package last updated on 29 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts