跳到主要内容

ILink

View source on GitHub

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
href?stringURL for the link-
id?stringLink identifier-
isHovered?booleanSets hovered state and link effects-
isTextOverflow?booleanActivates text-overflow with ellipsis-
noHover?booleanDisables hover effect-
enableUserSelect?booleanEnables user selection-
type?LinkTypeLink type (page or action)-
target?LinkTargetTarget attribute for link-
textDecoration?| "none" | "underline" | "line-through" | "overline" | "underline dotted" | "underline dashed"Text decoration style-
onClick?() => TReturnMessageClick handler (for action type links)-
textstringDefines the textIText.text
title?stringDefines the text titleIText.title
fontSize?stringDefines the text font sizeIText.fontSize
fontWeight?string | numberDefines the text font weightIText.fontWeight
truncate?booleanSpecifies whether the word wrapping is setIText.truncate
isBold?booleanSpecifies whether the text font weight is set to boldIText.isBold
isItalic?booleanSpecifies whether the text style is set to italicIText.isItalic
isInline?booleanSpecifies whether the "display: inline-block" property is setIText.isInline
textAlign?stringSpecifies whether the "text-align" property is setIText.textAlign
noSelect?booleanSpecifies whether the text selection is disabledIText.noSelect
display?stringSpecifies whether the "display" property is setIText.display
lineHeight?stringDefines the text line heightIText.lineHeight
color?stringDefines the text colorIText.color
className?stringDefines the CSS class for styling the component. Can be used to override or extend the default component styles.IText.className

LinkType

View source on GitHub

Defines the link type.

Enumeration Members

page

page: "page";

Regular page link

action

action: "action";

Action link (clickable but not navigating)


LinkTarget

View source on GitHub

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