File size: 736 Bytes
272ccb0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import reflex as rx
from reflex.style import color_mode, set_color_mode


def dark_mode_toggle() -> rx.Component:
    return rx.segmented_control.root(
            rx.segmented_control.item(
                    rx.icon(tag="monitor", size=20),
                    value="system",
                    ),
            rx.segmented_control.item(
                    rx.icon(tag="sun", size=20),
                    value="light",
                    ),
            rx.segmented_control.item(
                    rx.icon(tag="moon", size=20),
                    value="dark",
                    ),
            on_change=set_color_mode,
            variant="classic",
            radius="large",
            value=color_mode,
            )