Skip to documentation
Design system / Sources & standards
Current repository source
colorModeMenuItems.tsx
src/components/colorMode/colorModeMenuItems.tsx
This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.
"use client";
import { DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem } from "@/components/ui/dropdownMenu";
import { useColorMode } from "./useColorMode";
/** Internal composition of the account molecule; Radix owns keyboard behavior. */
export function ColorModeMenuItems() {
const { mode, setMode } = useColorMode();
return (
<div className="flex items-center justify-between gap-4" data-slot="color-mode-control">
<DropdownMenuLabel>Appearance</DropdownMenuLabel>
<DropdownMenuRadioGroup className="flex gap-1 rounded-md bg-muted p-1" aria-label="Color mode" value={mode} onValueChange={(value) => {
if (value === "light" || value === "dark") setMode(value);
}}>
<DropdownMenuRadioItem showIndicator={false} className="justify-center px-3 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground" value="light" disabled={!mode}>Light</DropdownMenuRadioItem>
<DropdownMenuRadioItem showIndicator={false} className="justify-center px-3 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground" value="dark" disabled={!mode}>Dark</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
</div>
);
}
All sources and standards