Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The default title of reactpy is 'ReactPy', how to customize the title? #1069

Unanswered
johe123qwe asked this question in Question
Discussion options

Current Situation

@component
def App():
 temps_list = read_last10('pi_temp.txt')
 return html._(
 html.title("raspberry pi temperature monitor"),
 html.h1("raspberry"),
 html.img({
 "src": "https://cdn.pixabay.com/photo/2016/11/27/21/42/stock-1863880_1280.jpg",
 "style": {"width": "10%", "margin_left": "0%"},
 }),
 DataList(temps_list),
 html.p('cpu load: {}'.format(load_avg)),
 html.p('uptime: {}'.format(GetTime())),
 )

Proposed Actions

I tried to check the documentation on the official website but I don't quite understand it.

You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

This can be done by passing extra options when configuring your application of choice:

from fastapi import FastAPI
from reactpy.backend.fastapi import configure, Options
from reactpy import html
...
app = FastAPI()
configure(app, my_component, Options(head=html.head(html.title("My Title"))))
You must be logged in to vote
3 replies
Comment options

Is there another option to do this? Like if I want to set the title once the app is running?

Comment options

At the moment, the best way to change the title during runtime is via JavaScript html.script('document.title = "My Title";')

Comment options

The documentation for things like this aren't very clear about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag-triage Not prioritized.
Converted from issue

This discussion was converted from issue #1068 on June 19, 2023 08:39.

AltStyle によって変換されたページ (->オリジナル) /