Skip to content

Reference for the user-facing components exported by lucode-starlight.

The theme exports a small component surface for docs authors. Most UI comes from Starlight component overrides installed by the plugin.

---
import { ContainerSection, Dropdown, LinkButton } from 'lucode-starlight/components';
---

A compact anchor styled like the theme’s buttons. Use it for calls to action inside custom MDX sections.

Get Started

Customize

Showcase

---
import { LinkButton } from 'lucode-starlight/components';
---
<LinkButton href="/lucode-starlight-theme/guides/getting-started/" variant="primary" size="md">
Get Started
</LinkButton>
PropTypeDefaultNotes
hrefstring, URL, null, or undefinedRequiredPassed to the underlying anchor.
variant'primary', 'secondary', or 'minimal''primary'Controls color and hover treatment.
size'2xs', 'xs', 'sm', 'md', or 'lg''md'Controls height, font size, and padding.
Other anchor attributesAstro HTMLAttributes<'a'>-target, rel, aria-*, class, and similar attributes are forwarded.

A layout wrapper that constrains content and adds responsive horizontal padding. It is useful on splash pages where you want full-width page sections that still align to the theme container.

Inside a section

This card grid is wrapped in a medium-width ContainerSection.

Responsive padding

The section increases inline padding across mobile, tablet, and desktop breakpoints.

---
import { ContainerSection } from 'lucode-starlight/components';
---
<ContainerSection width="lg">
<h2>Section Title</h2>
<p>Content goes here within a centered container.</p>
</ContainerSection>
PropTypeDefaultMax width
width'sm', 'md', 'lg', or 'xl''lg'640px, 768px, 1024px, or 1280px

A compound menu component for compact action lists, navigation groups, and small command menus. It supports click, keyboard navigation, and optional hover opening.

---
import { Dropdown } from 'lucode-starlight/components';
---
<Dropdown.Root>
<Dropdown.Trigger variant="secondary">Theme actions</Dropdown.Trigger>
<Dropdown.Content align="start">
<Dropdown.Label>Documentation</Dropdown.Label>
<Dropdown.Item as="a" href="/guides/getting-started/">
Getting Started
</Dropdown.Item>
<Dropdown.Item as="a" href="/guides/theming/">
Customize Theme
<Dropdown.Shortcut>CSS</Dropdown.Shortcut>
</Dropdown.Item>
<Dropdown.Separator />
<Dropdown.Item disabled>Coming Soon</Dropdown.Item>
</Dropdown.Content>
</Dropdown.Root>
PartPurpose
Dropdown.RootOwns dropdown state and wraps trigger plus content.
Dropdown.TriggerRenders the button that opens the menu.
Dropdown.ContentRenders the positioned menu panel.
Dropdown.ItemRenders an actionable menu row.
Dropdown.LabelRenders non-interactive group text.
Dropdown.SeparatorRenders a horizontal separator.
Dropdown.ShortcutRenders right-aligned shortcut or metadata text inside an item.
ComponentPropTypeDefault
Dropdown.RootopenOnHoverbooleanfalse
Dropdown.RootcloseDelaynumber200
Dropdown.TriggerasChildbooleanfalse
Dropdown.Triggervariant'primary', 'secondary', or 'minimal''secondary'
Dropdown.Triggersize'2xs', 'xs', 'sm', 'md', 'lg', 'icon-sm', 'icon-md', or 'icon-lg''sm'
Dropdown.Contentside'top', 'bottom', 'left', or 'right''bottom'
Dropdown.Contentalign'start', 'center', or 'end''start'
Dropdown.ContentsideOffsetnumber4
Dropdown.ContentanimationDurationnumber150
Dropdown.ItemasAstro HTMLTag'div'
Dropdown.Iteminsetbooleanfalse
Dropdown.Itemdisabledbooleanfalse
Dropdown.Labelinsetbooleanfalse

The plugin also provides component overrides for:

  • ThemeSelect
  • PageFrame
  • Header
  • SiteTitle
  • Sidebar
  • TwoColumnContent
  • ContentPanel
  • PageTitle
  • MarkdownContent
  • Hero
  • Footer
  • SocialIcons
  • Pagination
  • Search
  • TableOfContents
  • PageSidebar

You do not import these directly for normal use. Add the plugin and Starlight renders them for you.