HomeDashboard/.venv/lib/python3.12/site-packages/nicegui/functions/page_title.py
2026-01-03 14:54:18 +01:00

18 lines
448 B
Python

from .. import core, json
from ..context import context
def page_title(title: str) -> None:
"""Page title
Set the page title for the current client.
:param title: page title
"""
client = context.client
client.title = title
if core.app.native.main_window:
core.app.native.main_window.set_title(title)
if client.has_socket_connection:
client.run_javascript(f'document.title = {json.dumps(title)}')