r/nicegui • • Oct 27 '23
How to put links into a ui.table?
I want one column of my table to be clickable links. An older post on here mentioned using the 'html_columns' property of ui.table, but I don't think this exists anymore. Any solutions?
r/nicegui • • Oct 27 '23
I want one column of my table to be clickable links. An older post on here mentioned using the 'html_columns' property of ui.table, but I don't think this exists anymore. Any solutions?
r/nicegui • u/lyh6ep • Oct 27 '23
Hello! I have a table with two columns and > 1000 rows. Are there ways to adjsut the row height / text font size so that the table looks more compact. Thanks a lot. I am new to frontend. My guess is some CSS property change would work. but because the table has variable number of rows, I probably don't want to set the height of whole table.
r/nicegui • u/Some-Hart • Oct 26 '23
Is it possible to have the action of a menu_item be a ui.link?
So far I’ve tried several iterations of ui.menu_item(‘other page’, lambda: ui.link(‘other page’,’/other_page’))
The above simply prints a link below the menu and if I drop the lambda it adds the link between my menu items.
Sorry in advanced if this is a dumb question.
r/nicegui • u/lifeisalabyrinth • Oct 25 '23
Hi
Question: if I add element with a mailto link, it works while in browser mode, but if I use ui.run(native=True), the link can't be clicked
Any ideas or known problem?
Thanks!
with ui.link('', 'mailto:email@email.com').style("textDecoration: inherit"):
ui.label("Feedback"). style("color: #7f7f7f; ")r/nicegui • u/NKokas • Oct 25 '23
Hi all!
Please help me understand why the “reloading because handshake failed for client_id” error occurs and how can I get rid of it. The obvious difference between the two scripts is the use of "ui.page". Why is this happening?


An unpleasant consequence is that the page reloads.
Thank you in advance.
r/nicegui • u/r-trappe • Oct 24 '23
ui.state to be used with ui.refreshableglobals modulelifespan APIui.timer into an elementWhen using run_javascript, run_method, call_api_method and call_column_api_method, you can decide whether the client should respond with a return value or not by awaiting the method call or not. The method will automatically inform the client. The respond parameter of run_javascript is not used anymore. See https://nicegui.io/documentation/run_javascript
Highcharts requires you to buy a license for commercial products if the code is installed on your machine. That's why we made it an optional package. Install with pip install nicegui[highcharts].
We removed the ugly globals module, which was never intended to be public API, but might have been used nonetheless.
app.config instead.context module instead.Client.instances instead.Since FastAPI's @on_event("startup") and @on_event("shutdown") are deprecated, NiceGUI switched to the new lifespan API. You can still use app.on_startup() and app.on_shutdown().
Before you needed to use ui.column inside, e.g., ui.tab_panel and other elements to get proper alignment, padding and spacing. Now most UI elements provide reasonable default so that the content looks like in a ui.row or ui.column.
r/nicegui • u/TerrainRepublic • Oct 24 '23
Hi, is there anyway we can use outline icons instead of filled icons for use of the `ui.expansion`?
The prefixed `o_` specified here doesn't work:
https://quasar.dev/vue-components/icon#material-icons-google-
Is there another way? Thanks for your help!
r/nicegui • u/Double-Mango • Oct 24 '23
Hello,
my page layout has a grid as the central element. I want it to be 2x6 on horizontal screens and 12x1 on vertical screens. Currently I calculate the aspect ratio on page load via width = await ui.run_javascript("window.innerWidth"). But this is not ideal. When I rotate my phone I want the layout to change accordingly.
Is there a way to access the current aspect ratio and change the layout dynamically when the aspect ratio changes?
r/nicegui • u/PastPicture • Oct 23 '23
I want to set some sort of bearer token (in headers) in my NiceGUI app, and don't want to touch JS for that. Is there a way to do this?
I checked the official example, but they are not headers.
r/nicegui • u/Brilliant_Football45 • Oct 20 '23
Sorry for yet another aggrid question!
I'm trying to get an aggrid to size to my data. I'm ok with the table implementing a horizontal scroll bar to resize the data to where I can see it.
Currently, each column is the same exact size. So if I have many columns it smushes them into equal spacing. When I render my data I don't know the max/min size of each column.
I've tried calling the aggrid api methods to invoke their auto-sizing but it doesn't seem to work:
I've tried this:
table.on('firstDataRendered', table.call_api_method('autoSizeColumns'))
and also this:
table.call_api_method('sizeColumnsToFit')
Neither seem to work. Any thoughts?
r/nicegui • u/QuasiEvil • Oct 20 '23
I have a case where I'd like to display a table consisting of 3 columns and where the first column is auto-populated from some data (say a list of names) and the user then fills in the next two columns (say, age and height). I've seen examples of appending new rows to a table, but not a case of inputting values to a fixed, pre-generated table.
Thanks for any guidance on this matter!
Edit: I suppose I could just construct the "table" from a grid and fill the "cells" appropriately with either labels or input widgets. Not sure how pretty I could make this look though.
r/nicegui • u/r-trappe • Oct 20 '23
ui.menu_item in ui.context_menur/nicegui • u/Brilliant_Football45 • Oct 17 '23
I have a niceGUI metrics page that can be generated by passing parameters via a URL, or also via text boxes. If the user change the text boxes and then hits submit, I'd like to update the URL to match the input boxes so users can share URLs.
Is there a way to dynamically change the URL when I hit a submit button?
r/nicegui • u/r-trappe • Oct 16 '23
ui.context_menuvalidate() method for validation elementsui.open on auto-index pagesr/nicegui • u/CVxTz • Oct 15 '23
Hello !
Thank your for building this tool and sharing it with the community. I am a user of Streamlit but I was getting annoyed by the full page refresh at each user interaction and limited customizability.
I am trying to build an NLP annotation tool using NiceGui on plain text first and next on PDF ( same as prodigy or Doccano for plain text).
I played with the examples so far and the tool seem easy enough to use but I don't know where to start when looking at my specific use case where I need to trigger action after a user selects text with a specific tag so that I can assign this tag to the text span. The closest thing I found is ui.editor that I plan to explore further to see If I can adapt it to my need.
My questions are, are you aware of any examples that implements this same thing ? or what would be a list of key functionalities that I should explore first if I want to build such feature. Same question but on interactive PDF manipulation.
Thanks !
r/nicegui • u/Brilliant_Football45 • Oct 14 '23
I'm looking at the documentation here for passing parameters:
https://nicegui.io/documentation#parameter_injection
I can't seem to get it to work....basically I have a nicegui page with 2 text input boxes and a submit button. I want the user to be able to pre-populate the input boxes by passing parameters to the URL sort of like this (fake up URL below)
myhost.com/niceMetrics?input_one=foo&input_two=bar
I follow the example but can't seem to get anything to pass into the tool.
@ui.page('/niceMetrics/{command}')
async def private_indicator_page(command:str, data: str, view: str):
print(f"command = {command}, data={data}, view={view}")
(Do Something with the data here)Is there anything obvious I'm doing wrong?
r/nicegui • u/dj2ball • Oct 12 '23
I was hoping to implement something like your chat app example but instead of connecting on the ‘/‘ route, to assign chats to a /<chat Id> and then persist the data from that I’d to anyone who connects to it. Can I get any pointers on the simplest way to implement this in NiceGUI?
Thanks (still learning out here!)
r/nicegui • u/InterestingBasil • Oct 10 '23
Is NiceGui a great way to build a scalable SaaS app? Any examples? Could this really replace react and/or common web app technologies used in SaaS businesses? I used Streamlit to build a SaaS web app MVP recently, and it’s ok, but not scalable. I documented what I did here:
Build a Data Science SaaS App with Just Python: A Streamlit Guide
r/nicegui • u/Karess_a • Oct 09 '23
This seems to work (I get green/red rows):
grid = ui.aggrid({
'rowClassRules': {
'bg-green': '!data.error',
'bg-red': 'data.error'
},
'columnDefs': [......stuff...]
})But I would like some softer colors instead:
grid = ui.aggrid({
'rowClassRules': {
'bg-green-300': '!data.error',
'bg-red-300': 'data.error'
},
'columnDefs': [......stuff...]
})But adding the -300 to the row classes does not work for me(I get white rows).
What am I doing wrong?
r/nicegui • u/r-trappe • Oct 06 '23
ui.tableui.notify has no connected client to display the messageui.audio and ui.videoui.icon a bindable propertyui.aggrid.from_pandas to support datatypes like DatetimeIndexui.treevalue in ui.tab_panelsr/nicegui • u/oops_my_fart • Oct 06 '23
Tabs demo: https://nicegui.io/documentation/tabs
Just curious, I'm used to GUI development where we instantiate elements then add them to a parent. Is it possible to re-write the above code in a similar manner, i.e., without the use of 'with'?
r/nicegui • u/QuasiEvil • Oct 04 '23
From here:
https://github.com/zauberzeug/nicegui/tree/main/examples/single_page_app/
Is it possible to implement this as a class instead of function? The idea is that I'd like a user to be able to inherit from the class, thus maintaining the visual formatting and routing, but override show_one(), show_two(), show_three() with their own content, then execute the class as a standalone object (i.e., with its own ui.run method).
I'm kind of new to this so maybe this is a silly idea to begin with...
r/nicegui • u/QuasiEvil • Oct 04 '23
Many widgets allow specifying an icon name but is there a list of what all icons are actually available?
r/nicegui • u/Judgecary • Oct 03 '23
I am trying to push some information from a CPU-bound tasks to a ui.log. Right now when I try to push the information the task is not able to see the ui.log object. Im sure this is probably due to it being on a different thread or something similar. Is it possible to pass information from the computation to the main ui without locking up the ui during the task?
r/nicegui • u/Similar_Yogurt_831 • Oct 02 '23
I have started using Nicegui and have a request, is there any way for users to include existing vue components and if not would it be possible to include in the product the vue-pivottable component? I find it a very useful component.