A pre-built block for switching between light, dark, and system theme modes. Renders a button that opens a popover with three radio options — System, Dark, and Light — and persists the selection to localStorage. The button icon updates automatically to reflect the active mode.
---
import ThemeModeSelect from "../theme-mode-select.astro";
import { flex } from "@pindoba/styled-system/patterns";
---
<div
class={flex({
justify: "center",
})}
>
<ThemeModeSelect id="demo-theme-mode-select" />
</div>| Prop | |
|---|---|
id | id The id attribute for the root element and used to wire up the internal popover and radio button IDs. Defaults to a generated UUID. Type Default Required |
popoverProps | popoverProps Props forwarded to the internal Popover component, such as placement or onOpen/onClose callbacks. Type Default Required |
buttonProps | buttonProps Props forwarded to the trigger Button component, such as size or emphasis to customise the toggle button appearance. Type Default Required |
...rest | ...rest Standard HTML div attributes passed to the root element. Type Default Required |