Saltar al contenido principal
useAuth0Themes()
Hook de React para obtener las opciones del tema actual con la configuración consolidada desde el contexto de marca.

Devuelve

FlattenedTheme | nullObjeto FlattenedTheme que contiene configuraciones de colores, fuentes, bordes, pageBackground y widgets, o null si no hay ninguna configuración de marca disponible
Ejemplo
import React from 'react';
import { useAuth0Themes } from '@auth0/auth0-acul-react';

const ThemedComponent: React.FC = () => {
  const theme = useAuth0Themes();

  if (!theme) {
    return <div>No hay ningún tema disponible</div>;
  }

  return (
    <div
      style={{
        backgroundColor: theme.colors.primary_button,
        color: theme.colors.primary_button_label,
        borderRadius: theme.borders.button_border_radius,
      }}
    >
      <h1
        style={{
          fontWeight: theme.fonts.title.bold ? 'bold' : 'normal',
          fontSize: `${theme.fonts.title.size}%`,
        }}
      >
        Aplica el estilo con el tema de Auth0
      </h1>
      <button
        style={{
          backgroundColor: theme.colors.primary_button,
          borderRadius: theme.borders.button_border_radius,
        }}
      >
        Botón principal
      </button>
      <p>Color del texto del cuerpo: {theme.colors.body_text}</p>
    </div>
  );
};