Astro Eclipse
Gallery

Every effect, live.

Change the settings and press play. The page itself is the preview, and the call next to it is exactly what runs.

Origin
Direction (wipe, slide, flip, stairs ...)
Themes in the cycle

Cycle:

The switch passes duration: 0, which makes the change instant. The real OS setting is honored automatically with no code on your side. Your system reports reduced motion: ….

Preview

A loop of the selected effect with your settings. Press play to run it on this whole page.

The call

setTheme()

All effects

  • Blinds blinds

    Eight slats open one beside the other. The direction sets which way they grow. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="blinds"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'blinds',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'blinds',
    })
  • Blur blur

    Both themes blur while they cross-fade. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="blur"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'blur',
        duration: 600,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'blur',
    })
  • Blur circle blur-circle

    The new theme grows from the origin as a circle, sharpening as it opens.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="blur-circle"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'blur-circle',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'blur-circle',
    })
  • Circle circle

    The new theme grows from the origin as a circle until it covers the screen.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="circle"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'circle',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'circle',
    })
  • Circle inverse circle-inverse

    The old theme shrinks into the origin and uncovers the new one.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="circle-inverse"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'circle-inverse',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'circle-inverse',
    })
  • Clock clock

    A radial sweep like a clock hand, one full turn from twelve o'clock, around the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="clock"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'clock',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'clock',
    })
  • Cover cover

    The new theme slides in over the old one, which stays put. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="cover"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'cover',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'cover',
    })
  • Cross cross

    The new theme grows from the origin as a plus sign.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="cross"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'cross',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'cross',
    })
  • Curtain curtain

    Two shutters close in from opposite edges and meet in the middle. The direction sets the axis. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="curtain"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'curtain',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'curtain',
    })
  • Diagonal diagonal

    A slanted edge sweeps across the screen in the chosen direction. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="diagonal"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'diagonal',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'diagonal',
    })
  • Diagonal soft diagonal-soft

    A diagonal sweep with a soft, feathered edge. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="diagonal-soft"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'diagonal-soft',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'diagonal-soft',
    })
  • Diamond diamond

    The new theme grows from the origin as a diamond.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="diamond"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'diamond',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'diamond',
    })
  • Fade fade

    A plain cross fade between the two themes. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="fade"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'fade',
        duration: 600,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'fade',
    })
  • Flip flip

    The page turns like a card, in 3D, around the axis of the direction. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="flip"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'flip',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'flip',
    })
  • Heart heart

    The new theme grows from the origin as a heart.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="heart"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'heart',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'heart',
    })
  • Iris iris

    The new theme opens from the origin as a hexagon, like a camera iris.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="iris"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'iris',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'iris',
    })
  • Mosaic mosaic

    A grid of squares opens in a scattered order until the new theme fills the screen. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="mosaic"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'mosaic',
        duration: 600,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'mosaic',
    })
  • Reveal reveal

    The old theme slides away and uncovers the new one. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="reveal"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'reveal',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'reveal',
    })
  • Ripple ripple

    Rings spread from the origin and merge into the new theme.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="ripple"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'ripple',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'ripple',
    })
  • Scan scan

    Forty thin slats reveal the new theme like a scan line. The direction sets which way it travels. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="scan"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'scan',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'scan',
    })
  • Slide slide

    The new theme pushes the old one off the screen in the chosen direction. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="slide"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'slide',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'slide',
    })
  • Spin spin

    The new theme spins in from nothing, growing as it turns. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="spin"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'spin',
        duration: 600,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'spin',
    })
  • Split split

    The new theme opens from the middle outward. The direction sets the axis. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="split"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'split',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'split',
    })
  • Square square

    The new theme grows from the origin as a square.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="square"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'square',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'square',
    })
  • Stairs stairs

    Ten columns (or rows) grow one after the other in the chosen direction. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="stairs"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'stairs',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'stairs',
    })
  • Star star

    The new theme grows from the origin as a five-pointed star.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="star"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'star',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'star',
    })
  • Sunburst sunburst

    The new theme bursts from the origin as a twelve-point sun.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="sunburst"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'sunburst',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'sunburst',
    })
  • Triangle triangle

    The new theme grows from the origin as a triangle.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="triangle"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'triangle',
        duration: 600,
        origin: event,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'triangle',
    })
  • Wipe wipe

    A straight edge sweeps across the screen in the chosen direction. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="wipe"
      direction="down"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'wipe',
        duration: 600,
        direction: 'down',
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'wipe',
    })
  • Zoom zoom

    The old theme shrinks away while the new one settles in from slightly larger. Ignores the origin.

    Unverified in real browsers.

    Ready-made button
    <ThemeToggle
      themes={['light', 'dark']}
      transition="zoom"
    />
    Your own script
    import { setTheme } from 'astro-eclipse/client'
    
    button.addEventListener('click', (event) => {
      setTheme('dark', {
        transition: 'zoom',
        duration: 600,
      })
    })
    Default for the whole site
    // astro.config.mjs
    eclipse({
      themes: ['light', 'dark'],
      transition: 'zoom',
    })