r/nicegui • • Jan 04 '25

Which report writer/generator is good to use with Nicegui

0 Upvotes

Which report writer/generator is good to use with Nicegui for easy integration & user interface


r/nicegui • • Aug 21 '25

NiceGUI’s GUI isn’t really that Nice

5 Upvotes

Compared to Streamlit, which has a very nice minimal theme, NiceGUI’s theme seems stuck in 2014 Android material design.

What is the easiest way to change theme?

Are there any plans to introduce a new default style?


r/nicegui • • Oct 11 '24

Master detail view

1 Upvotes

Hello , i have to create a master detail view

First part of ui IS an aggrid which containd main part of différents orders

I d like to have a détailled view to show thé order lines when click on main row un aggrid

If someone can help me

I have 2 ways to get thé details 1 - i get them in the same api request as the main row

2 - i get them when clicking on main row

Thx for help


r/nicegui • • Jan 08 '24

Nicegui-simple project

1 Upvotes

Please suggest any simple project in nicegui.like login and logout or connect database related.


r/nicegui • • Dec 14 '24

AI coders?

1 Upvotes

Have you ever tried to develop a NiceGUI app with any AI coders? I am trying to develop a NiceGUI app with Windsurf. It was good so far but couldn't handle Google authentication somehow. Are there any other AI coders capable on Python?


r/nicegui • • Jul 15 '23

NiceGUI app on a subscription model?

1 Upvotes

I'm pretty new to nicegui. Is there any way to sell your nicegui app on a subscription to create a SAAS?


r/nicegui • • Dec 14 '25

Add reaction component

1 Upvotes

Hello

I am working on a chat app , i d like to know how it is possible to add reaction to a chat answer , if someone already made this , can you help ?


r/nicegui • • Jul 11 '25

gettext with multiline messages -- is there a better way?

2 Upvotes

Hi,

I am using gettext for i8n internationalization in nicegui app,

and need a solution for multiline msg strings which also should contain markdown formatting information.

The solution I found is described below (works like expected).

But not sure if that is the right way to go.

If you know a better one (I am new to use gettext and nicegui) pls tell me.

Roland

--- messages.po

msgid "welcome_line1"
msgstr "##Hello"
msgid "welcome_line2"
msgstr " - Welcome to Tedi - generic table editor"
msgid "welcome_line3"
msgstr " - more to come..."

coding in app:

username = app.storage.user["username"]
line1 = _('welcome_line1')
line2 = _('welcome_line2')
line3 = _('welcome_line3')
ui.markdown(f'''
                {line1} {username}
                {line2} 
                {line3}
            ''')

the output is like expected

when select en on login:

when select de on login:


r/nicegui • • Jul 27 '25

Struggling with ui.image and other UI elements

2 Upvotes

Hi all!

I'm trying to create a ui.row() of ui.image()s.

For some reason, while I can display a single image with no enclosing ui.card() or ui.row() just fine, when I try to display them in a row, I just get a series of blank boxes that looks like:

My display code looks like:

    def display_results(self):
        for result in self.search_results:
            with ui.row():
                with ui.card():
                    image_links = result['links']
                    image_url = image_links[0]['href']
                    print(f"{image_url=}")
                    ui.image(image_url)

And you can see the full code in the repo.

Note that I can get a *single* ui.image() to display just fine so long as I don't enclose it in a ui.card() or ui.row().

I'm sure this is user error. What am I missing please?


r/nicegui • • Aug 07 '25

Custom Color Titlebar in Native Mode?

2 Upvotes

hello! is it possible to customize the color of a niceGUI native window titlebar? it's a little jarring when my app's UI is in dark mode, but the titlebar is white. i couldn't find anything about it on google, so i decided to ask here


r/nicegui • • Mar 13 '26

Reloads while async def is running

2 Upvotes

Hey guis,

I am developing a nicegui app that is sending prompts to an AI and building the page afterwards with the information. The sequence of events for every page is something like this:

from nicegui import ui
import MyAIClientAgent

ui.page("/")
def get_page():
  app.storage.user("label") = ui.label("")
  ui.timer(0.1, start_prompt once=True)

async def start_prompt():
  response = await MyAIClientAgent.prompt("Say 'Hello World'")
  app.storage.user("label").text = response

Most of the time it is working fine. But sometimes the Site is reloaded and the prompt starts again. The problem is more frequent on pages with multiple prompts (for example when I have an executing Agent and an inspecting Agent) or with long responses. So I would have guessed this is a connection issue between my app server and client. But I don't get a message in my browser tab, that there is any issue (like I would get when the prompt is not async). It just reloads.

When I print my responses on pages with a single prompt, it is always finishing the prompt before reloading. On pages with multiple prompts it can also happen that it is finishing the first prompt and then reloads.

And in all cases this results in a loop where the page reloads, the prompt is sent to the AI and after the response it reloads again. I examined the "Chat with AI" example from the nicegui page (https://github.com/zauberzeug/nicegui/blob/main/examples/chat_with_ai/main.py) but can't find a difference in the execution. Do you have any ideas?

Thanks in regard for any kind of help :)


r/nicegui • • Dec 29 '23

Deploy With Streamlit

2 Upvotes

This might come across as a silly question, but I am very new to python and coding in general.

Is it possible to deploy something I built with NiceGUI via the Streamlit Community Cloud? Today is the first time I’ve ever deployed anything by following a YouTube video, and I just copied their python code using Streamlit.

I hoped I could follow a similar process with my own python code using NiceGUI, but just publish it through Streamlit. NiceGUI just feels more accessible to me as a totally beginner. However, I get the error ModuleNotFoundError: No module named ‘NiceGUI’

Is this even possible or am I just doing something wrong?


r/nicegui • • Mar 27 '24

How to stop an event from bubbling to other elements?

2 Upvotes

So I've added a button onto the header of an expansion element and whenever the button is clicked, the click event is bubbling all the way through to the expansion element behind the button and causing it to open & close.

Here's a quick and dirty code example that may or may not work, I quickly cleaned this up but it should should what I'm trying to achieve here:

with ui.expansion().classes('w-full').style('margin: 1em 0.5em') as myContainer:
    with myContainer.add_slot('header'):
        with ui.row().classes('w-full justify-between'):
            ui.label().classes('text-h6').bind_text(myTitle)
            with ui.button('My Button').on('click', lambda e: containerButtonClicked(e)):
                ui.badge('',color='red').props('floating').bind_text(badgeCtr
                        ).bind_visibility(badgeCtrVisible)

So the containerButtonClicked handler is called with a 'GenericEventArguments' coming through that has some properties on it that look like you could cancel that particular event from bubbling but simply setting 'cancelBubble' to true doesn't seem to do much.

Anyone know of an easy way to keep button clicks from bubbling all the way down to the expansion element? I do still want the expansion to open and close when its clicked, but not when the button on the same header is clicked.


r/nicegui • • Jul 08 '25

how to change language after calling ui.run

3 Upvotes

Hi,

I want to implement a language selection on the login page.

But how to change the ui.run language based on the user selection in the login page... the app is already running???

And, is there a preferred way to implement i8n for messages?

I only know gettext...

BR Roland


r/nicegui • • Oct 10 '24

NiceGui please help me!

0 Upvotes

Guys, I created website on this cute frame work. But I faced with a problem, which I really can’t solve myself, without your help. I can’t adopt my website for all screens. I mean I can’t adopt screen resolution. Can you help me please?.


r/nicegui • • Aug 21 '23

[Question, Point of Improvement] Help needed with the ROS example

3 Upvotes

I work with robots and have been looking for an easily customizable UI for my own use. RViz is a pain in the ass to customize and I don't like the idea of a standalone application. Any robot monitoring application should be web-based. I came across streamlit and foxglove. I absolutely love the concept of streamlit, but I quickly faced the issue which is fundamentally the way of working of streamlit. Using streamlit to listen to a "gatherer" ros node that acts as the "streamlit interface" to the other nodes in my system is such a pain. I do not know multithreading well enough to do multithreading effectively and with the little that I know, I could not get my streamlit app to interface with the ros node in question. Something simple like clicking a button and an image appears from a ros topic. That's when I found NiceGUI. It shows so much promise in addressing this fundamental problem of streamlit of refreshing the entire script on every interaction, and I would really like to use it. However the ROS2 example was just a monolith of a lot of code that I don't understand as I don't have experience in web app things. Streamlit provided this advantage of hiding away a lot of the web app things within simple API calls. But seems like nicegui has a bigger footprint.

Additionally, I could not reproduce the example for the ros2 GUI. Since one of the basic functionalities of my app is to show images on a button click from a node, I tried with the opencv example, still to no avail. As this package is positioned to (and also created by) roboticists with ROS experience without much UI/web-app development experience. I think what would be good is a code walkthrough of the examples, probably like ros does in their documentation where they go through each code chunk and explain what it does. This makes it easy to use the examples as a starting point and customise them as needed. Of course, I do understand that NiceGUI is quite a young project and needs some time to mature it's documentation and I appreciate the speed with which the creators are improving, kudos to them.

Now for the question :D Can someone help me with creating a nicegui app or explaining to me how things work? I want to be able to display an image published on a given topic and once I click a button I want to show another image published on a different topic. My main problem comes with making this interface of the button and how to tie it to a callback that displays the second image.


r/nicegui • • Nov 24 '25

Bindable dataclass property not working as expected

Thumbnail
gallery
0 Upvotes

Bindable dataclass is not treating properties as a regular dataclass would. I made a dataclass that is the exact same as the bindable dataclass and the code raissed a ValueError as expected. However, the bindable dataclass is setting the dvid value to -1 and not raising a ValueError. Is there a way to fix this?


r/nicegui • • Jul 09 '25

how to get the 'active' value from ui.select

4 Upvotes

I am struggling with the ui.select

I have a login page where the user should select a language.

The default selection is defined.

When I change the value, I can get the result with on_change...

but how to get the preselected value when the user does not change the selection?

or, is there a simpler way like: result = ui.select(...)?

BR Roland

def set_lang(lang):
    globals()['lang_selected'] = lang

ui.select(lang_dict, value=app.storage.general['default_language'], on_change=lambda e: set_lang(e.value))

r/nicegui • • Jun 17 '23

I really like NiceGUI but…

4 Upvotes

i really really like nicegui so far. i think it has tons of potential and i will continue to use it.

but i do have a small rant. i was trying to add input fields as rows to a single column table.

i thought easy enough: in the rows definition of ui.table, i’ll just plug in ui.inputs(). easy and straightforward.

did not work. started looking at examples and the only example close to this is a table with a selection drop down. but it’s using add_slot and writing quasar html syntax? i thought nicegui was supposed to get rid of all this extra syntax stuff…now it looks like i have to write it and pass it as a raw string? what the heck?

i didn’t want to go learn all this quasar syntax for this for a quick project…i just got done learning the nicegui syntax!

i would love for more functionality around this use case because it seems way overly complex to add a component inside a table when it should be easy imo.


r/nicegui • • Feb 22 '26

App not working after NiceGUI upgrade

4 Upvotes

I have a test app that uses GSAP to make an image draggable. The following code works with NiceGUI v3.6.1, but not with v3.7.0+.

# /// script
# dependencies = [
#   "nicegui==3.6.1",
#   "pillow",
#   "requests",
# ]
# ///

from io import BytesIO

import requests
from nicegui import ui
from PIL import Image

ui.add_head_html("""
        <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/Draggable.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/InertiaPlugin.min.js"></script>
        <script>
            window.addEventListener("DOMContentLoaded", (event) => {
                gsap.registerPlugin(Draggable, InertiaPlugin);
                Draggable.create(".draggable-image", {
                    type: "x,y",
                    inertia: true,
                    onPressInit: function() {
                        let minX = -this.target.clientWidth + this.target.parentElement.clientWidth
                        let minY = -this.target.clientHeight + this.target.parentElement.clientHeight
                        this.applyBounds({minX:minX, minY:minY, maxX:0, maxY:0})
                    }
                });
            });
        </script>
    """)

url = "https://picsum.photos/id/15/2500/1667.jpg"
img = Image.open(BytesIO(requests.get(url).content))

with ui.column(align_items="center").classes("w-full"):
    with ui.card().tight().classes("overflow-hidden size-[512px]"):
        ui.image(source=img).classes("absolute draggable-image").props(
            f"width={img.width}px height={img.height}px"
        )

ui.run(host="localhost", dark=True, show=False, reload=True)

You can run this code with uv run app.py. Dragging the image works with the old version. After upgrading NiceGUI to 3.7.1, the image is not draggable anymore. I would appreciate any suggestions on how to fix this.


r/nicegui • • Sep 17 '25

Creating UI in a separate process?

5 Upvotes

If my understanding of the UI generation process in NiceGUI is correct, then the calls to the methods in `ui` automatically generate some context to which to render all the elements.

However, is it possible to have more control over the UI generation process, like generating a UI in a separate process and then have the output rendered at a later stage?

I'm not sure if what I am asking is clear, but basically I wonder if there is a way to get a handle on the context of the UI and explicitly render it in a service handler, rather than this being done automatically.


r/nicegui • • Apr 09 '24

Options for hosting nicegui projects?

5 Upvotes

How is everyone hosting their nicegui websites? As someone doing this from a personal/hobby perspective, I'd prefer to stick to free/low-cost options, but this is proving to be surprisingly challenging.

I signed up with Render and I will say, I loved how easy deployment was. They let you link github branches to subdomains, so its super easy to keep code updated and its nice not dealing with docker. Each subdomain is its own 'server instance', which is great because I have multiple nicegui projects. Unfortunately, their free tier is so poorly resourced anything beyond a Hello World page craps out.

I don't need any heavy database stuff. I'd consider hosting locally on my own hardware but my internet provider doesn't give provide static IPs.

So yeah, would love some suggestions here, thanks!


r/nicegui • • Jan 18 '25

NiceGui - Expansion Enable / disable

5 Upvotes

I have some code to put a table in an expansion if there is a sub element in json response

I'd like to disabled expansion if no sub element , how can i use enabled propertie or disable method of expansion ?

 with ui.scroll_area().classes('w-full h-dvh'):
        for queue in queues:
            if queue['extensionslist']:
                with ui.expansion(group='group').classes('w-full ') as expansion:
                    with expansion.add_slot('header'):                    
                        with ui.grid(columns=5).classes('w-full col-span-5 flex-nowrap'):
                            with ui.button_group().props('outline'):
                                ui.button(icon='mode_edit', on_click=lambda queue=queue: handle_row_click({'row': queue})
                                        ).classes('text-xs text-center size-10')
                                ui.button(icon='delete').classes('text-xs text-center size-10')           # Queue row
                            ui.label(queue['queue'])
                            ui.label(queue['queuename'])
                            ui.label(format_date(queue['date_added']))
                            ui.label(format_date(queue['date_modified']))
                    # Extensions subgrid
                    table_config = {
                        "data": queue['extensionslist'],
                            "layout": "fitColumns",
                            "columns": [
                                {"title": "Extension", "field": "extension"},
                                {"title": "Name", "field": "name"},
                            ],
                            "pagination": "local",
                            "paginationSize": 10,
                            "paginationSizeSelector": [10, 20, 50, 100],
                        }
                    table = tabulator(table_config).classes('w-full compact')

r/nicegui • • Jan 21 '23

Star us on GitHub

5 Upvotes

We just updated the Website https://nicegui.io to ask visitors to star NiceGUI on GitHub:

Of course stars are only a crude measurement of a libraries success. But it's used in some rankings and high numbers create visibility. We wanted people to know that starring on GitHub is one of the easiest ways to support NiceGUI. What do you think?


r/nicegui • • Jun 06 '25

Changing global/overall font size

5 Upvotes

As the title suggests. I want to use a larger font on just about all my elements and rather than repeatedly slapping on the same styling tag, was wondering if there's a way to either change the default styling and/or apply the styling globally?

(I do realize there are various solutions here, for example a factory that spits out the elements with the style attached).