Skip to main content

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.

Downloads


✨ 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) به‌صورت تمیز و کاربردی می‌تونه این شکلی باشه:


📌 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

nicegui_extras-0.1.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nicegui_extras-0.1.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file nicegui_extras-0.1.2.tar.gz.

File metadata

  • Download URL: nicegui_extras-0.1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for nicegui_extras-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3b4f55b21c58c6effc15a7bc1668847dc41dc7580b1de528f97f216229caab33
MD5 8687df42aff2b447d564b6231eb65836
BLAKE2b-256 746f5b8d14237ad66ff202d1cf2fd00851051a0b6854a97163522fc690e930c1

See more details on using hashes here.

File details

Details for the file nicegui_extras-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: nicegui_extras-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for nicegui_extras-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6af27e1e9a0e03d456ac814a2dde93bdd4eee6233db2a6566347c31c61167859
MD5 413a2ec81fea48c74b232975a870b4f9
BLAKE2b-256 b17ad0cf2cea7cf197153dbc4602378514296292e4dbd27f41d99c0cbfa7b071

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page