Theme schedulePro
Oxyn original: Light, Dark, Sun or your own hours on a 24-hour strip; drag along it to preview the day and the sample turns with it.
oxyn add theme-scheduleLight and dark
Your hours: light 07:00–19:00. Turns dark in 1 h.
The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Let the app go light and dark by the clock – always, with the sun, or on your own hours – and show what any time of day will look like.
When not to use
- Picture tiles we draw ourselves plus Your own, with Film, Static or Dither laid over the picture and a home screen preview: use Background picker instead.
- Eight mini-window swatches: use Theme grid instead.
- Oxyn original: use Theme split instead.
Installation
Theme schedule is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add theme-scheduleUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Default
Your hours, light 07:00–19:00, previewed at 18:00: an hour of light left.
Light and dark
Your hours: light 07:00–19:00. Turns dark in 1 h.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Follows the sun
Sun: light from sunrise to sunset; at 18:00 the sample has already turned dark.
Light and dark
Follows the sun: light 06:42–17:18. Turns light in 12 h 42 min.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Night owl
Light from 22:00 to 08:00, a window that wraps past midnight, previewed at 23:30.
Light and dark
Your hours: light 22:00–08:00. Turns dark in 8 h 30 min.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Always dark
Dark all day: the hour sliders rest.
Light and dark
Always dark.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ThemeSchedule
| Prop | Type | Default | Description |
|---|---|---|---|
default_mode | String | "custom" | Starting mode (`light`, `dark`, `sun`, `custom`). |
default_from | u32 | 420 | Light from (minutes after midnight). |
default_to | u32 | 1140 | Dark from (minutes after midnight). |
default_at | u32 | 1080 | The previewed time (minutes after midnight). |
on_change | EventHandler<(String, u32, u32)> | — | Mode or hours changed: (mode, from, to). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Modes, the strip, then the two hour sliders |
| LeftorRight on the strip | Preview 15 minutes earlier or later |
| LeftorRight on a slider | Moves that hour by 15 minutes |
Accessibility
- Modes are a radio group; the summary line is a polite live region that says when the next switch comes.
- The strip is a native range named Preview time; its value text gives the time and the theme it shows.
- Hour sliders carry their time as aria-valuetext and are disabled outside Custom.
Responsive behaviour
- 560 px card; the sample stacks over the sliders under 480 px.
Edge cases (spec)
The sample stacks over the sliders under 480 px.
Notes for AI
- Import
ThemeSchedulefromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
ThemeScheduleElinoxyn_gpui. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.