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.

Make an entire shape clickable:

import { Slide, Shape, Paragraph, TextRun } from "@office-open/pptx";

new Slide({
    children: [
        new Shape({
            x: 1,
            y: 1,
            width: 4,
            height: 1,
            text: "Visit our website",
            paragraphs: [
                new Paragraph({
                    children: [
                        new TextRun({ text: "Visit our website", color: "0563C1", underline: {} }),
                    ],
                }),
            ],
            hyperlink: {
                url: "https://example.com",
                tooltip: "Go to example.com",
            },
        }),
    ],
});

Apply a hyperlink to a specific portion of text:

new Shape({
    x: 1,
    y: 1,
    width: 6,
    height: 3,
    paragraphs: [
        new Paragraph({
            children: [
                new TextRun({ text: "For more info, visit " }),
                new TextRun({
                    text: "our documentation",
                    color: "0563C1",
                    underline: {},
                    hyperlink: {
                        url: "https://docs.example.com",
                        tooltip: "Open documentation",
                    },
                }),
                new TextRun({ text: " for details." }),
            ],
        }),
    ],
});

Use a mailto: URL to create an email hyperlink:

new TextRun({
    text: "Contact Support",
    color: "0563C1",
    underline: {},
    hyperlink: {
        url: "mailto:support@example.com",
        tooltip: "Send email to support",
    },
});

Navigate to a specific slide within the presentation:

new Shape({
    x: 1,
    y: 4,
    width: 3,
    height: 0.8,
    text: "Go to Summary",
    hyperlink: {
        slide: 3, // Navigate to slide index 3 (0-based)
        tooltip: "Jump to summary slide",
    },
});
PropertyTypeDescription
urlstringExternal URL or mailto: link
slidenumberTarget slide index (0-based)
tooltipstringTooltip text shown on hover

Note: Use either url or slide, not both.

Copyright © 2026