A collection of CSS and utility helpers for NiceGUI
Project description
NiceGUI-Extras
NiceGUI-Extras is a helper package for NiceGUI that provides ready-to-use UI enhancements and utilities to make your NiceGUI apps more beautiful and flexible.
✨ Features
✅ Right-to-left (RTL) layout support
✅ Sticky top navigation menu
✅ Link-to-button converter
✅ Animated dialogs
✅ Scroll disabling utility
🚀 Installation
pip install nicegui-extras
💡 How to Use
🧩 In nicegui_extras.utils
Right-to-left Persian layout
from nicegui_extras.utils import farsi_rtl
farsi_rtl() # enables RTL and Vazir font automatically
Disable page scrolling
from nicegui_extras.utils import no_scroll
no_scroll() # disables scrolling on page
🎨 In nicegui_extras.style
Link as button
from nicegui_extras.style import link_button
def link_button(text: str, url: str, new_tab: bool = False):
"""Create a link styled as a button."""
classes = 'q-btn q-btn-item non-selectable no-outline q-btn--flat q-btn--rectangle'
return ui.link(text, url, new_tab=new_tab).classes(classes)
Usage:
link_button('Visit Site', 'https://nicegui.io', new_tab=True)
💬 Animated dialog (CSS class)
For now, you can use this class directly to make a dialog animated and blurred:
animated_dialog = 'backdrop-filter="blur(8px) brightness(20%)"'
Example:
ui.dialog().props(animated_dialog)
📌 Sticky Menu Row
To create a sticky top menu that stays fixed at the top of the page and keeps content visible below it, use the following helper:
from nicegui_extras.layout import menu_row
with menu_row(side='left', height='70px'):
ui.button('Home')
ui.button('Docs')
ui.button('GitHub')
ui.label('Page content starts here...')
This will create a top menu bar that:
- stays fixed when scrolling
- aligns all items from the left side
- automatically adds margin so that other elements do not overlap with the menu
🧠 Example App
from nicegui import ui
from nicegui_extras.utils import farsi_rtl, no_scroll
from nicegui_extras.style import link_button, menu_row
farsi_rtl()
no_scroll()
with ui.row().style(menu_row):
ui.label('Main Menu')
link_button('Home', '/home')
ui.run()
🧑💻 Author
Created by Ali Heydari — a Python developer and NiceGUI enthusiast. More features like improved dark mode and ready-made themes are coming soon!
📜 License
MIT License © 2025 Ali Heydari
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nicegui_extras-0.1.3.tar.gz.
File metadata
- Download URL: nicegui_extras-0.1.3.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58f02657b816ea9258ed9c2d8e2d681ebc76170d627aeffbcd880a615a83fb8e
|
|
| MD5 |
517c263391ef8df2f787141b8dd36a31
|
|
| BLAKE2b-256 |
0ad39146bbf8b34cc8ad6d37a7fc9cb8c3655b43ebbc808229a68002ea9fa36c
|
File details
Details for the file nicegui_extras-0.1.3-py3-none-any.whl.
File metadata
- Download URL: nicegui_extras-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebab0aee2138d3e738e97baa0867d28c4d8a1cccc9108b15543c01c1466d121e
|
|
| MD5 |
06e3fcbd5ac961a15bab58d4ee7ec63a
|
|
| BLAKE2b-256 |
1c5092a2423e169dada6a5c0feaf3930e476205f604dd95453d03b6d459aafc2
|