Skip to main content

ILink

Defines the link component properties.

linklink

Example​

import { ILink, LinkType, LinkTarget } from "@onlyoffice/docspace-plugin-sdk";

const link: ILink = {
href: "https://example.com",
text: "Visit Example",
type: LinkType.page,
target: LinkTarget.blank,
isBold: false,
color: "accent",
fontSize: "14px",
onClick: () => {
console.log("Link clicked");
}
};

Extends​

Properties​

PropertyTypeDescriptionInherited from
hrefstringURL for the link-
idstringLink identifier-
isHoveredbooleanSets hovered state and link effects-
isTextOverflowbooleanActivates text-overflow with ellipsis-
noHoverbooleanDisables hover effect-
enableUserSelectbooleanEnables user selection-
typeLinkTypeLink type (page or action)-
targetLinkTargetTarget attribute for link-
textDecoration"none" | "line-through" | "overline" | "underline" | "underline dotted" | "underline dashed"Text decoration style-
onClick() => TReturnMessageClick handler (for action type links)-
textstringDefines the textIText.text
titlestringDefines the text titleIText.title
fontSizestringDefines the text font sizeIText.fontSize
fontWeightstring | numberDefines the text font weightIText.fontWeight
truncatebooleanSpecifies whether the word wrapping is setIText.truncate
isBoldbooleanSpecifies whether the text font weight is set to boldIText.isBold
isItalicbooleanSpecifies whether the text style is set to italicIText.isItalic
isInlinebooleanSpecifies whether the "display: inline-block" property is setIText.isInline
textAlignstringSpecifies whether the "text-align" property is setIText.textAlign
noSelectbooleanSpecifies whether the text selection is disabledIText.noSelect
displaystringSpecifies whether the "display" property is setIText.display
lineHeightstringDefines the text line heightIText.lineHeight
colorstringDefines the text colorIText.color
classNamestringDefines the CSS class for styling the component. Can be used to override or extend the default component styles.IText.className

LinkType​

Defines the link type.

Enumeration Members​

page​

page: "page";

Regular page link

action​

action: "action";

Action link (clickable but not navigating)


LinkTarget​

Defines the link target attribute.

Enumeration Members​

blank​

blank: "_blank";

Opens in a new tab

self​

self: "_self";

Opens in the same frame

parent​

parent: "_parent";

Opens in the parent frame

top​

top: "_top";

Opens in the full body of the window