Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

ThemeToggleMessages

interfaz Since 1.4.0

Textos accesibles de <MeekoThemeToggle> además de los nombres de los temas (labels), para traducirlos. Todos son opcionales; los de por defecto están en español.

ts
import type { ThemeToggleMessages } from "@meekojs/meeko/framework";

Source code src/shared/theme.ts:465

Declaración #

ts
interface ThemeToggleMessages {
	readonly cycle?: (current: string, next: string) => string
	readonly unknown?: string
	readonly group?: string
}

Example #

meeko
<MeekoThemeToggle
  bind:labels="{ light: 'Light', dark: 'Dark', system: 'System' }"
  bind:messages="{ cycle: (current, next) => `Theme: ${current}. Switch to ${next}`, unknown: 'Switch theme', group: 'Theme' }"
/>

Propiedades #

cycle #

propiedad sólo lectura opcional

readonly cycle?: (current: string, next: string) => string

aria-label del botón en mode="cycle": recibe la etiqueta de la elección actual y la del tema al que pasa. Por defecto, «Tema: oscuro. Cambiar a sistema» (las etiquetas, en minúscula).

unknown #

propiedad sólo lectura opcional

readonly unknown?: string

aria-label del botón cuando la página todavía no conoce la elección: el HTML de una página prerenderizada o de una petición sin la cookie, hasta que termina la hidratación. Por defecto, «Cambiar tema».

group #

propiedad sólo lectura opcional

readonly group?: string

aria-label del grupo de radios en mode="select". Por defecto, «Tema».

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/shared/theme.ts