En construcciónNumori se está construyendo en abierto. Todavía no hay nada en venta y la mayoría de las aplicaciones están sin terminar.Ver qué está listo

UiThemeToggle

A stateless light/dark toggle button.

Contenido

An icon button that flips between light and dark. Deliberately stateless: it shows the state you pass as isDark and emits toggle, leaving persistence to the host (@nuxtjs/color-mode, VueUse, or two hand-written lines). The sun and moon share a cell and cross-fade with a quarter turn. Because dark mode depends on a client-only preference, wrap it in <ClientOnly> when server-rendering to avoid a hydration mismatch.

Ejemplos

Light / dark

It renders the state you give it and emits toggle for you to flip.

<UiThemeToggle
  :is-dark="state.dark"
  :label="state.dark ? 'Switch to light mode' : 'Switch to dark mode'"
  @toggle="state.dark = !state.dark"
/>

Props

NombreTipoPor defectoDescripción
isDarkbooleanfalseWhether the dark theme is active; chooses which glyph shows.
labelstring'Toggle theme'Accessible name and tooltip; describe the action, e.g. "Switch to dark mode".

Eventos

EventoDatosDescripción
togglenoneEmitted when the button is pressed; the parent flips the theme.