Sha256: c60dbc8a797ca7b48a0b2a8886bc9e8a3e08dda830ed1402d6919699449d2fb9

Contents?: true

Size: 984 Bytes

Versions: 124

Compression:

Stored size: 984 Bytes

Contents

import React, { useState } from 'react'
import { CopyButton, Body, TextInput, Textarea } from 'playbook-ui'

const CopyButtonFrom = (props) => {
  const [text, setText] = useState("Copy this text input text")

  const handleChange = (event) => {
    setText(event.target.value);
  }

  return (<div>
    <Body id="body">Copy this body text!</Body>
    <CopyButton
        {...props}
        from="body"
        marginBottom="sm"
        text="Copy Body text"
        tooltipPlacement="right"
        tooltipText="Body text copied!"
    />

    <TextInput
        {...props}
        id="textinput"
        onChange={handleChange}
        value={text}
    />
    <CopyButton
        {...props}
        from="textinput"
        marginBottom="sm"
        text="Copy Text Input"
        tooltipPlacement="right"
        tooltipText="Text input copied!"
    />

    <Textarea
        {...props}
        placeholder="Copy and paste here"
    />
  </div>
  )
}

export default CopyButtonFrom

Version data entries

124 entries across 124 versions & 2 rubygems

Version Path
playbook_ui_docs-14.13.0.pre.alpha.rails8compatible6232 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui-14.13.0.pre.alpha.rails8compatible6232 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui_docs-14.13.0.pre.alpha.rails8compatible6229 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui-14.13.0.pre.alpha.rails8compatible6229 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui_docs-14.13.0.pre.alpha.rails8compatible6228 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui-14.13.0.pre.alpha.rails8compatible6228 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui-14.14.0 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui_docs-14.13.0.pre.alpha.PBNTR457formtimezoneselect6219 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui-14.13.0.pre.alpha.PBNTR457formtimezoneselect6219 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui_docs-14.13.0.pre.alpha.play1852reacthookformsupportradio6213 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui-14.13.0.pre.alpha.play1852reacthookformsupportradio6213 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui_docs-14.13.0.pre.alpha.advsncedtablefix6185 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui-14.13.0.pre.alpha.advsncedtablefix6185 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui_docs-14.14.0.pre.rc.5 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui-14.14.0.pre.rc.5 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui_docs-14.13.0.pre.alpha.PLAY1856doc6166 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui-14.13.0.pre.alpha.PLAY1856doc6166 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui_docs-14.13.0.pre.alpha.play1754pbtagprogressradio6160 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui-14.13.0.pre.alpha.play1754pbtagprogressradio6160 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
playbook_ui_docs-14.13.0.pre.alpha.play1852reacthookformsupportradio6153 app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx