ILink
Defines the link component properties.
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
| Property | Type | Description | Inherited from |
|---|---|---|---|
href? | string | URL for the link | - |
id? | string | Link identifier | - |
isHovered? | boolean | Sets hovered state and link effects | - |
isTextOverflow? | boolean | Activates text-overflow with ellipsis | - |
noHover? | boolean | Disables hover effect | - |
enableUserSelect? | boolean | Enables user selection | - |
type? | LinkType | Link type (page or action) | - |
target? | LinkTarget | Target attribute for link | - |
textDecoration? | | "none" | "underline" | "line-through" | "overline" | "underline dotted" | "underline dashed" | Text decoration style | - |
onClick? | () => TReturnMessage | Click handler (for action type links) | - |
text | string | Defines the text | IText.text |
title? | string | Defines the text title | IText.title |
fontSize? | string | Defines the text font size | IText.fontSize |
fontWeight? | string | number | Defines the text font weight | IText.fontWeight |
truncate? | boolean | Specifies whether the word wrapping is set | IText.truncate |
isBold? | boolean | Specifies whether the text font weight is set to bold | IText.isBold |
isItalic? | boolean | Specifies whether the text style is set to italic | IText.isItalic |
isInline? | boolean | Specifies whether the "display: inline-block" property is set | IText.isInline |
textAlign? | string | Specifies whether the "text-align" property is set | IText.textAlign |
noSelect? | boolean | Specifies whether the text selection is disabled | IText.noSelect |
display? | string | Specifies whether the "display" property is set | IText.display |
lineHeight? | string | Defines the text line height | IText.lineHeight |
color? | string | Defines the text color | IText.color |
className? | string | Defines 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