PPTX
Links
Add hyperlinks to shapes and text for interactive navigation
Add clickable hyperlinks to shapes or text runs for web navigation, email links, or internal slide references.
Hyperlink on a Shape
Make an entire shape clickable:
{
"slides": [
{
"children": [
{
"shape": {
"x": "1.3cm",
"y": "1.3cm",
"width": "10.6cm",
"height": "2.6cm",
"textBody": {
"children": [
{
"children": [
{
"text": "Visit our website",
"fill": "0563C1",
"underline": "SINGLE",
"hyperlink": { "url": "https://example.com", "tooltip": "Go to example.com" }
}
]
}
]
}
}
}
]
}
]
}
import { generatePresentation } from "@office-open/pptx";
generatePresentation({
slides: [
{
children: [
{
shape: {
x: "1.3cm",
y: "1.3cm",
width: "10.6cm",
height: "2.6cm",
textBody: {
children: [
{
children: [
{
text: "Visit our website",
fill: "0563C1",
underline: "SINGLE",
hyperlink: { url: "https://example.com", tooltip: "Go to example.com" },
},
],
},
],
},
},
},
],
},
],
});
Hyperlink on Text Run
Apply a hyperlink to a specific portion of text:
{
"slides": [
{
"children": [
{
"shape": {
"x": "1.3cm",
"y": "1.3cm",
"width": "15.9cm",
"height": "7.9cm",
"textBody": {
"children": [
{
"children": [
{ "text": "For more info, visit " },
{
"text": "our documentation",
"fill": "0563C1",
"underline": "SINGLE",
"hyperlink": {
"url": "https://docs.example.com",
"tooltip": "Open documentation"
}
},
{ "text": " for details." }
]
}
]
}
}
}
]
}
]
}
import { generatePresentation } from "@office-open/pptx";
generatePresentation({
slides: [
{
children: [
{
shape: {
x: "1.3cm",
y: "1.3cm",
width: "15.9cm",
height: "7.9cm",
textBody: {
children: [
{
children: [
{ text: "For more info, visit " },
{
text: "our documentation",
fill: "0563C1",
underline: "SINGLE",
hyperlink: {
url: "https://docs.example.com",
tooltip: "Open documentation",
},
},
{ text: " for details." },
],
},
],
},
},
},
],
},
],
});
Email Link
Use a mailto: URL to create an email hyperlink:
{
"slides": [
{
"children": [
{
"shape": {
"x": "1.3cm",
"y": "1.3cm",
"width": "10.6cm",
"height": "2.6cm",
"textBody": {
"children": [
{
"children": [
{
"text": "Contact Support",
"fill": "0563C1",
"underline": "SINGLE",
"hyperlink": {
"url": "mailto:support@example.com",
"tooltip": "Send email to support"
}
}
]
}
]
}
}
}
]
}
]
}
import { generatePresentation } from "@office-open/pptx";
generatePresentation({
slides: [
{
children: [
{
shape: {
x: "1.3cm",
y: "1.3cm",
width: "10.6cm",
height: "2.6cm",
textBody: {
children: [
{
children: [
{
text: "Contact Support",
fill: "0563C1",
underline: "SINGLE",
hyperlink: {
url: "mailto:support@example.com",
tooltip: "Send email to support",
},
},
],
},
],
},
},
},
],
},
],
});
Tooltip
Hyperlink Options
| Property | Type | Description |
|---|---|---|
url | string | External URL or mailto: link |
slide | number | Target slide index (0-based) |
tooltip | string | Tooltip text shown on hover |
Note: Use either
urlorslide, not both.