Copybox input

Copybox input is a component that allows users to copy the content of an input field to the clipboard.

Examples Default
<dap-ds-copybox-input
label="Name"
placeholder="Enter your name">
</dap-ds-copybox-input>
Sizes
<dap-ds-stack>
<dap-ds-copybox-input
  label="Xs Name"
  size="xs"
  feedback="This is a feedback message"
  feedbacktype="negative"
  placeholder="Enter your name">
</dap-ds-copybox-input>
<dap-ds-copybox-input
  label="Sm Name"
  size="sm"
  feedback="This is a feedback message"
  feedbacktype="negative"
  placeholder="Enter your name">
</dap-ds-copybox-input>
<dap-ds-copybox-input
  label="Lg Name"
  size="lg"
  feedback="This is a feedback message"
  feedbacktype="negative"
  placeholder="Enter your name">
</dap-ds-copybox-input>
</dap-ds-stack>
States
<dap-ds-stack>
<dap-ds-copybox-input
  disabled
  label="Disabled"
  placeholder="Enter your name"
  value="John Doe">
</dap-ds-copybox-input>
<dap-ds-copybox-input
  readonly
  label="Readonly"
  placeholder="Enter your name"
  value="John Doe">
</dap-ds-copybox-input>
</dap-ds-stack>
Importing
import { DapDSCopyBoxInput } from 'dap-design-system/dist/dds'
Importing React
import { DapDSCopyBoxInputReact } from 'dap-design-system/dist/react'
Attributes
PropertyTypeDefaultDescription
copyButtonAriaLabelstringThe aria label of the copy button.
typestring'text'
labelstringThe label of the input.
placeholderstringThe placeholder of the input.
descriptionstringThe description of the input.
tooltipstringThe tooltip of the input.
tooltipPlacement'top', 'right' , 'bottom' , 'left'The position of the tooltip. Can be top, right, bottom, or left.
status'success', 'error'The status of the input. Can be success or error.
size'xs', 'sm' , 'sm'The size of the input. Default is sm.
namestringThe name of the input.
valuestringThe value of the input.
disabledbooleanThe disabled state of the input. Default is false.
requiredbooleanThe required state of the input. Default is false.
readonlybooleanThe readonly state of the input. Default is false.
autofocusbooleanThe autofocus state of the input. Default is false.
feedbackstringThe feedback of the input.
feedbackType'negative', 'positive' , 'warning'The feedback type of the input. Can be negative, positive, or warning.
loadingbooleanThe loading state of the input. Default is false.
optionalbooleanThe optional state of the input.
optionalLabelstringThe optional label of the input.
subtlebooleanThe weight of the label. Default is false
Slots

No slots available.

Events
Event NameDescriptionType
dds-copyFired when the user clicks on the copy button.{value: string }
dds-changeFired when the input value changes.{value: string }
dds-inputFired when the input value changes.{value: string }
dds-keydownFired when a key is pressed down.{value: string, originalEvent: Event }
dds-blurFired when the input loses focus.{void }
dds-focusEmitted when the input gains focus.{void }
dds-not-allowedEmitted when the value cannot be copied.{void }
CSS Parts
Part NameDescription
baseThe base container of the component.
postfixThe inner postfix icon part of the component.
buttonThe button of the component.
CSS Custom Properties
Property NameDescription
--dds-input-heightThe height of the input. Default is var(--dds-spacing-1000).
--dds-input-paddingThe padding of the input. Default is var(--dds-spacing-300).
--dds-input-font-sizeThe font size of the input. Default is var(--dds-font-base).
--dds-input-border-colorThe border color of the input. Default is var(--dds-border-neutral-base).
--dds-input-background-colorThe background color of the input. Default is var(--dds-fields-background-default).
--dds-input-text-colorThe text color of the input. Default is var(--dds-text-neutral-base).
--dds-input-border-radiusThe border radius of the input. Default is var(--dds-radius-base).
--dds-input-border-widthThe border width of the input. Default is var(--dds-border-width-base).
--dds-input-disabled-backgroundThe background color of the disabled input. Default is var(--dds-fields-background-disabled).
--dds-input-disabled-textThe text color of the disabled input. Default is var(--dds-text-neutral-disabled).
--dds-input-readonly-backgroundThe background color of the readonly input. Default is var(--dds-fields-background-read-only).
--dds-input-readonly-textThe text color of the readonly input. Default is var(--dds-text-neutral-subtle).
--dds-input-success-borderThe border color of the success input. Default is var(--dds-border-positive-base).
--dds-input-error-borderThe border color of the error input. Default is var(--dds-border-negative-base).
--dds-input-addon-backgroundThe background color of the input addon. Default is var(--dds-background-ui-neutral-enabled).
--dds-input-addon-success-backgroundThe background color of the success input addon. Default is var(--dds-background-ui-positive-enabled).
--dds-input-addon-error-backgroundThe background color of the error input addon. Default is var(--dds-background-ui-negative-enabled).