Skip to content

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",
});

Look at the right sidebar. Above the table of contents, you should see:

  1. Copy page — A pill-shaped button to copy this page’s markdown source.
  2. ↑ (scroll to top) — A round button that smoothly scrolls to the top of the page.
  3. ⋮ (kebab menu) — A round button that opens a dropdown with all available actions.

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.

Content for section A. Verify the compact actions appear correctly above the table of contents.

Content for section B. The kebab menu should open a dropdown with all enabled actions.

Content for section C. Both the compact actions and the table of contents are visible in the right sidebar.