@cloudflare/component-copyable-textarea
    TypeScript icon, indicating that this package has built-in type declarations

    3.3.50 • Public • Published

    @cloudflare/component-copyable-textarea

    Cloudflare Copyable Textarea Component

    Installation

    Installation with yarn is recommended

    $ yarn add @cloudflare/component-copyable-textarea
    

    Usage

    CopyableTextarea has option to use self-defined text and ids for translation component.

    import React from 'react';
    import { CopyableTextarea } from '../../src';
    
    class CopyableTextareaComponent extends React.Component {
      render() {
        return (
          <>
            <CopyableTextarea
              name="copyable-textarea-example"
              value="Some nice text that needs to be copied"
            />
            // passing self-defined id(s) for translation
            <CopyableTextarea
              name="copyable-textarea-example"
              value="Some nice text that needs to be copied"
              clickToCopyTextId = 'api.click_to_copy'
              copiedTextToClipboardTextId = 'api.copied_to_clipboard'
              pressCommandOrCtrlCToCopyTextId = 'api.copy_failed'
            />
            // passing self-defined translation fallback messages
            <CopyableTextarea
              name="copyable-textarea-example"
              value="Some nice text that needs to be copied"
              clickToCopyTextId = 'api.click_to_copy'
              copiedTextToClipboardTextId = 'api.copied_to_clipboard'
              pressCommandOrCtrlCToCopyTextId = 'api.copy_failed'
              clickToCopyText = 'Click to copy API token'
              copiedTextToClipboardText = 'API tokens copied to clipboard'
              pressCommandOrCtrlCToCopyText = 'Failed to copy API token'
            />
          </>
        );
      }
    }
    
    export default CopyableTextareaComponent;

    Keywords

    none

    Install

    npm i @cloudflare/component-copyable-textarea

    DownloadsWeekly Downloads

    589

    Version

    3.3.50

    License

    BSD-3-Clause

    Unpacked Size

    153 kB

    Total Files

    9

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar