Default Setup
This page demonstrates the plugin with the default configuration — no options passed.
plugins: [starlightPageContextAction()];What You Should See
Section titled “What You Should See”Look at the right sidebar. Above the table of contents, you should see:
- Copy page — Click to copy this page’s markdown source to your clipboard.
- Open in Chat — Click to expand a dropdown with links to ChatGPT, Claude, and T3 Chat.
- Scroll to top — Click to smoothly scroll back to the top of the page.
Testing the Copy Button
Section titled “Testing the Copy Button”Click the Copy page button in the sidebar. The icon will change to a checkmark for 3 seconds to confirm the content was copied. Paste the copied text into any editor to verify it contains the raw markdown of this page.
Testing the AI Dropdown
Section titled “Testing the AI Dropdown”Click the Open in Chat button to reveal the dropdown. Each link opens in a new tab with the default prompt:
Read src/content/docs/examples/default.mdx. I want to ask questions about it.
The {url} placeholder is replaced with this page’s URL automatically.
Mobile View
Section titled “Mobile View”Resize your browser to a mobile width (below 50rem). You should see a “Page Actions” toggle in the mobile bar alongside the “On this page” toggle. Tapping it reveals a dropdown with all enabled actions. Opening one dropdown automatically closes the other.
Multiple Headings for ToC
Section titled “Multiple Headings for ToC”The following headings exist to verify that page actions appear correctly above a populated table of contents.
Section A
Section titled “Section A”Content for section A. This helps demonstrate that the table of contents still works normally alongside page actions.
Section B
Section titled “Section B”Content for section B. The plugin does not interfere with any existing Starlight features.
Section C
Section titled “Section C”Content for section C. Both page actions and the table of contents are visible in the right sidebar.