Skip to content
API reference

components/copy-field

Import
import * as api from "@fungi.computer/caps/components/copy-field";
Kind Export Description
type alias CopyFieldTokenKind The colour role of one run of text in a block’s code.
type alias CopyFieldToken One run of a block’s code; the runs, joined, are the copied value.
type alias CopyFieldProps Props accepted by CopyField.
function CopyField() A value with an explicit copy action and visible outcome: wrapped code by default, a labelled read-only input when fieldLabel is given, or a titled code panel with layout="block".

CopyFieldTokenKindtype alias

Section titled “CopyFieldTokenKind”
Signature
type CopyFieldTokenKind = "text" | "tag" | "attribute" | "string";

The colour role of one run of text in a block’s code.


CopyFieldTokentype alias

Section titled “CopyFieldToken”
Signature
type CopyFieldToken = object;

One run of a block’s code; the runs, joined, are the copied value.

Signature
kind: CopyFieldTokenKind;
Signature
text: string;

CopyFieldPropstype alias

Section titled “CopyFieldProps”
Signature
type CopyFieldProps = object &
| {
value: string;
fieldLabel?: undefined;
displayValue?: undefined;
layout?: "inline";
title?: undefined;
tokens?: undefined;
}
| {
value: string;
fieldLabel: string;
displayValue?: string;
layout?: "inline";
title?: undefined;
tokens?: undefined;
}
| object &
| {
value: string;
tokens?: undefined;
}
| {
tokens: readonly CopyFieldToken[];
value?: undefined;
} & Omit<HTMLAttributes<HTMLElement>, "children" | "title">;

Props accepted by CopyField.

Name Type Description
label? string Copy action text; the code presentations default to “Copy”.
Signature
function CopyField(__namedParameters): Element;

A value with an explicit copy action and visible outcome: wrapped code by default, a labelled read-only input when fieldLabel is given, or a titled code panel with layout="block".

Parameter Type
__namedParameters CopyFieldProps

Element