Compact Layout
This page demonstrates the plugin with the compact layout — where the actions are displayed as a pill button with a kebab overflow menu.
To enable this layout for your site, configure the layout option:
starlightPageContextAction({ layout: "compact",});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 — A pill-shaped button to copy this page’s markdown source.
- ↑ (scroll to top) — A round button that smoothly scrolls to the top of the page.
- ⋮ (kebab menu) — A round button that opens a dropdown with all available actions.
Compact vs Spread
Section titled “Compact vs Spread”The spread layout (default) displays actions as a vertical list of buttons. The compact layout condenses them into a single row with a primary action and an overflow menu — ideal for keeping the sidebar clean.
On mobile, both layouts show the same compact “Page Actions” dropdown in the mobile bar.
Compare this page with the default setup example to see the difference.
Multiple Headings for ToC
Section titled “Multiple Headings for ToC”Section A
Section titled “Section A”Content for section A. Verify the compact actions appear correctly above the table of contents.
Section B
Section titled “Section B”Content for section B. The kebab menu should open a dropdown with all enabled actions.
Section C
Section titled “Section C”Content for section C. Both the compact actions and the table of contents are visible in the right sidebar.