scheme | ColorScheme | — | scheme={value} | Current color scheme; supports bind:scheme. Takes priority over defaultScheme on mount. A click updates it, and it also follows root-attribute changes while document synchronization is active. |
defaultScheme | ColorScheme | — | defaultScheme={value} | Initial uncontrolled scheme on mount; scheme takes priority. If neither is set, reads the page root. With applyToDocument=false, falls back to light. |
applyToDocument | boolean | true | applyToDocument | Synchronize current state to document.documentElement with theme="dark", removing theme for light. false disables reading, writing, and observing that page attribute; the caller owns the theme target. Does not write storage. |
ariaLabel | string | — | ariaLabel="Example" | Override the accessible Button name. By default, describes the state that clicking will switch to and follows LocaleProvider. |
lightIcon | Snippet | — (built-in graphic) | lightIcon={lightIconContent} | Replace the Sun icon shown while the current scheme is light. Changes graphics only, not switching logic. |
darkIcon | Snippet | — (built-in graphic) | darkIcon={darkIconContent} | Replace the Moon icon shown while the current scheme is dark. Changes graphics only, not switching logic. |
children | Snippet | — | <ColorSchemeButton>Content</ColorSchemeButton> | Custom content after the state icon. Without it, the host Button uses iconOnly layout automatically. |
disabled | boolean | false | disabled | Disable the Button action without preventing synchronization of an external binding or page attribute. |
onSchemeChange | (scheme: ColorScheme) => void | — | onSchemeChange={(value) => { /* handle value */ }} | Receive the new value after a user click. Initialization, external assignments, and observed page-attribute changes do not call it. |
onclick | (event: MouseEvent) => void | — | onclick={(value) => { /* handle value */ }} | Called before the state switches on a valid click. In the current implementation, preventDefault() does not cancel the subsequent switch. Not called when disabled. |