# ui.run | NiceGUI

[Button: icon:menu]

[](/)

[Installation](/#installation)

[Features](/#features)

[Demos](/#demos)

[Documentation](/documentation)

[Examples](/examples)

[Why?](/#why)

[Button]

[Button]

[](https://github.com/zauberzeug/nicegui/)

[Button: icon:more_vert]

# ui.*run*

## ui.run

You can call `ui.run()` with optional arguments.
Most of them only apply after stopping and fully restarting the app and do not apply with auto-reloading.

:root: root page function (*added in version 3.0.0*)
:host: start server with this host (defaults to `'127.0.0.1` in native mode, otherwise `'0.0.0.0'`)
:port: use this port (default: 8080 in normal mode, and an automatically determined open port in native mode)
:title: page title (default: `'NiceGUI'`, can be overwritten per page)
:viewport: page meta viewport content (default: `'width=device-width, initial-scale=1'`, can be overwritten per page)
:favicon: relative filepath, absolute URL to a favicon (default: `None`, NiceGUI icon will be used) or emoji (e.g. `'🚀'`, works for most browsers).
    In Windows native mode, a local `.ico` file path is also applied as the native window icon.
:dark: whether to use Quasar's dark mode (default: `False`, use `None` for "auto" mode)
:language: language for Quasar elements and the ``lang`` attribute of the ``html`` tag
    (default: ``None``, in which case Quasar elements use ``'en-US'`` and the ``lang`` attribute is omitted, *updated in version 3.14.0*)
:binding_refresh_interval: interval for updating active links (default: 0.1 seconds, bigger is more CPU friendly, *since version 3.4.0*: can be ``None`` to disable update loop)
:reconnect_timeout: maximum time the server waits for the browser to reconnect (default: 3.0 seconds)
:message_history_length: maximum number of messages that will be stored and resent after a connection interruption (default: 1000, use 0 to disable, *added in version 2.9.0*)
:cache_control_directives: cache control directives for internal static files (default: `'public, max-age=31536000, immutable, stale-while-revalidate=31536000'`)
:gzip_middleware_factory: GZipMiddleware factory function (e.g. ``lambda app: GZipMiddleware(app, minimum_size=500, compresslevel=9)``, defaults to Starlette's ``GZipMiddleware``, can be ``None`` to disable, *added in version 3.5.0*)
:fastapi_docs: enable FastAPI's automatic documentation with Swagger UI, ReDoc, and OpenAPI JSON (bool or dictionary as described `here <https://fastapi.tiangolo.com/tutorial/metadata/>`_, default: `False`, *updated in version 2.9.0*)
:show: automatically open the UI in a browser tab (default: `True`, opens "/", *since version 3.6.0*: you can pass a specific path like "/path/to/page")
:on_air: tech preview: `allows temporary remote access <https://nicegui.io/documentation/section_configuration_deployment#nicegui_on_air>`_ if set to `True` (default: disabled)
:native: open the UI in a native window of size 800x600 (default: `False`, deactivates `show`, automatically finds an open port)
:window_size: open the UI in a native window with the provided size (e.g. `(1024, 786)`, default: `None`, also activates `native`)
:fullscreen: open the UI in a fullscreen window (default: `False`, also activates `native`)
:frameless: open the UI in a frameless window (default: `False`, also activates `native`)
:reload: automatically reload the UI on file changes (default: `True`)
:uvicorn_logging_level: logging level for uvicorn server (default: `'warning'`)
:uvicorn_reload_dirs: string with comma-separated list for directories to be monitored (default is current working directory only)
:uvicorn_reload_includes: string with comma-separated list of glob-patterns which trigger reload on modification (default: `'*.py'`)
:uvicorn_reload_excludes: string with comma-separated list of glob-patterns which should be ignored for reload (default: `'.*, .py[cod], .sw.*, ~*'`)
:tailwind: whether to use Tailwind CSS (experimental, default: `True`)
:unocss: use UnoCSS with the specified preset instead of Tailwind CSS (default: ``None``, options: "mini", "wind3", "wind4", *added in version 3.7.0*)
:prod_js: whether to use the production version of Vue and Quasar dependencies (default: `True`)
:endpoint_documentation: control what endpoints appear in the autogenerated OpenAPI docs (default: 'none', options: 'none', 'internal', 'page', 'all')
:storage_secret: secret key for browser-based storage (default: `None`, a value is required to enable ui.storage.user and ui.storage.browser)
:session_middleware_kwargs: additional keyword arguments passed to SessionMiddleware that creates the session cookies used for browser-based storage
:show_welcome_message: whether to show the welcome message (default: `True`)
:markdown: whether to serve a Markdown representation when a client sends ``Accept: text/markdown``
    (experimental, default: `False`, can be overwritten per page, *added in version 3.11.0*)
:kwargs: additional keyword arguments are passed to `uvicorn.run`

main.py

[Button]

````python
from nicegui import ui

ui.label('page with custom title')

ui.run(title='My App')
````

## Emoji favicon

You can use an emoji as favicon.
This works in Chrome, Firefox and Safari.

main.py

[Button]

````python
from nicegui import ui

ui.label('NiceGUI rocks!')

ui.run(favicon='🚀')
````

## Base64 favicon

You can also use an base64-encoded image as favicon.

main.py

[Button]

````python
from nicegui import ui

ui.label('NiceGUI with a red dot!')

icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='

ui.run(favicon=icon)
````

## SVG favicon

And directly use an SVG as favicon.
Works in Chrome, Firefox and Safari.

main.py

[Button]

````python
from nicegui import ui

ui.label('NiceGUI makes you smile!')

smiley = '''
    <svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
        <circle cx="100" cy="100" r="78" fill="#ffde34" stroke="black" stroke-width="3" />
        <circle cx="80" cy="85" r="8" />
        <circle cx="120" cy="85" r="8" />
        <path d="m60,120 C75,150 125,150 140,120" style="fill:none; stroke:black; stroke-width:8; stroke-linecap:round" />
    </svg>
'''

ui.run(favicon=smiley)
````

## Custom welcome message

You can mute the default welcome message on the command line setting the `show_welcome_message` to `False`.
Instead you can print your own welcome message with a custom startup handler.

main.py

[Button]

````python
from nicegui import app, ui

ui.label('App with custom welcome message')

app.on_startup(lambda: print('Visit your app on one of these URLs:', app.urls))

ui.run(show_welcome_message=False)
````

**Nice**GUI

The Python UI framework that shows up in your browser.

[](https://github.com/zauberzeug/nicegui/)

[](https://discord.gg/TEpFeAaF4f)

[](https://www.reddit.com/r/nicegui/)

Resources

[Documentation](/documentation)

[Examples](/examples)

[LLM reference](/llms.txt)

[GitHub](https://github.com/zauberzeug/nicegui/)

[PyPI](https://pypi.org/project/nicegui/)

Community

[Discussions](https://github.com/zauberzeug/nicegui/discussions)

[Discord](https://discord.gg/TEpFeAaF4f)

[Reddit](https://www.reddit.com/r/nicegui/)

[Contributing](https://github.com/zauberzeug/nicegui/blob/main/CONTRIBUTING.md)

[Sponsors](https://github.com/sponsors/zauberzeug)

Legal

[Imprint](/imprint_privacy#imprint)

[Privacy](/imprint_privacy#privacy)

Made with NiceGUI by [Zauberzeug](https://zauberzeug.com)

© 2026 [Zauberzeug GmbH](https://zauberzeug.com)