Skip to main content

A powerful multibackend GUI framework for Python. Made for declarative UI creation

Project description

Nevu UI Intro Banner

alt text

Wiki link(BETA!)

Nevu UI means: Nevu is Eleven times better Versus other UI's User Interface

Brief Description

Nevu UI is a library for the declarative creation of user interfaces in python. The project aims to provide developers with a set of ready-made, stylable, and extensible components for the rapid creation of modern and responsive interfaces in games and multimedia applications.

The main goal of Nevu UI: to make creating interfaces in python easier and faster

Key features include:

  • Layout system: Convenient arrangement of elements, for example, using grids (Grid) and scrollable containers (ScrollableColumn).
  • Set of widgets: Ready-to-use elements such as buttons, input fields, and labels.
  • Flexible styling: The ability to customize the appearance through a style system that supports colors, gradients, and borders.
  • Animations: Built-in support for animations to create dynamic and lively interfaces.
  • Declarativeness: Support for declarative interface creation

Style banner


Style - storage of parameters for customizing the appearance

Editable parameters:

  • Gradient
  • ColorTheme - Analogous to MaterialDesign, there is a ready-made set of themes - ColorThemeLibrary
  • Font name/size
  • Border Width/Radius
  • Text Align X/Y
  • Transparency

Style banner


Nevu UI allows you to describe an interface with a clear structure

Examples of declarativeness:

  • Declarative approach: Describe your interface just as you see it.
    # Specify content directly when creating the layout
    grid = ui.Grid(content={(1,1): ui.Button(...)})
    
  • Adaptive size system (SizeRules): Forget about pixels. Use relative values that adjust to the size of the window or parent element.
    • vh / vw: Percentage of the window's height/width.
    • fillx / filly / fill: Percentage of the parent layout's height/width/size.
    • gc / gcw / gch: Percentage of the grid cell size.
    • Prefix c: can be placed in any SizeRule, it means that the current value will be taken (without the prefix, the original will be taken).
  • Powerful style system: Customize every aspect of the appearance using the universal Style object.
    • Themes: Ready-made color themes in ColorThemeLibrary.
    • Gradients: Support for linear and radial.
    • Image: Support for a background image via the bgimage parameter.
    • And much more: Fonts, borders, rounding, transparency.
  • Built-in animations: Bring your interface to life with ready-made animations for movement, transparency, etc.
    • 25+ built-in animations
    • There are 2 types of animations:
      • Start - Allows you to set the initial appearance of the widget.
      • Infinite - Produces an infinite animation defined in animation_manager.
    • Usage example:
      • Start: widget.animation_manager.add_start_animation(ui.animations.EaseOut(...))
      • Infinite: widget.animation_manager.add_continuous_animation(ui.animations.EaseOut(...))

Parameter System (ParamEngine):

  • ParamEngine is a convenient tool built into all layouts and widgets, it allows you to:
    • Declaratively add variables to the object's __init__
    • Check the variable type during initialization and after
    • Integrate a parameter into different stages of initialization
    • Retrieve parameter values via self.get_param(param_name).get()
    • Set parameter values via self.get_param(param_name).set(value)
  • Examples:
    import nevu_ui as ui
    from typing import Unpack, NotRequired
    
    #Create a TypedDict with variables (optional, but looks nice)
    class MyWidgetKwargs(ui.WidgetKwargs):
        my_var: NotRequired[int | float]
    
    class MyWidget(ui.Widget):
        def __init__(self, size: NvVector2 | list, style: Style = default_style, **param_kwargs: Unpack[MyWidgetKwargs]):
            super().__init__(size, style, **param_kwargs)
    
        #Override the function to add parameters (mandatory)
        def _add_params(self):
            super()._add_params()
    
            #Add a parameter (mandatory)
            self._add_param('my_var', int | float)
    
            #You can also add a link to a parameter
            #self._add_param_link('my_var', 'my_var_new_name')
    
            #You can also block a parameter if necessary
            #self._block_param('my_var')
    

Style banner


Dependencies:

Python >= 3.12.*

  • For Building:
    • setuptools >= 61.0
    • Cython
    • numpy
  • For Running:
    • numpy
    • Pillow
  • Additional libraries:
    • pygame-ce>=2.3.0
    • raylib
    • pyyaml

Installation via pip

pip install nevu-ui[all]

Style banner


Example1

Example2

Example3


Basic Grid

Declarative Approach

import nevu_ui as ui #Import Nevu UI
import pygame

pygame.init()

class MyGame(ui.Manager): #Create the base of our application
    def __init__(self):
        super().__init__(ui.Window((400, 300), title = "My Game")) #Initialize the manager
        style = ui.Style(borderradius=20, colortheme=ui.ColorThemeLibrary.material3_dark) #Create Style (optional)
        self.menu = ui.Menu(self.window, [100%ui.vw, 100%ui.vh], style = style, #Create a menu
                            layout= ui.Grid([100%ui.vw, 100%ui.vh], row=3, column=3, #Create a grid layout
                                            content = {
                                                (2, 2): ui.Button(lambda: print("You clicked!"), "BUTTON!", [50%ui.fill, 50%ui.gc], style=style) #Create a button
                                            }
                                            )
                            )
    def on_draw(self):
        self.menu.draw() #draw the menu
    def on_update(self, events):
        self.menu.update() #update the menu

game = MyGame()
game.run() #Run the finished application

Imperative Approach

import nevu_ui as ui #Import Nevu UI
import pygame

pygame.init()

window = ui.Window((400, 300), title = "My Game") #Create a window

style = ui.Style(borderradius=20, colortheme=ui.ColorThemeLibrary.material3_dark) #Create Style
menu = ui.Menu(window, [100%ui.vw, 100%ui.vh], style=style) #Create a menu
layout = ui.Grid([100%ui.vw, 100%ui.vh], row=3, column=3) #Create a grid layout
layout.add_item(ui.Button(lambda: print("You clicked!"), "BUTTON!", [50%ui.fill, 50%ui.gc], style=style), x = 2, y = 2) #Create a button

menu.layout = layout #Set the menu layout

while True: #Main loop
    events = pygame.event.get() #Get events
    window.update(events) #Update the window
    menu.update() #Update the menu
    menu.draw() #Draw the menu
    pygame.display.update() #Update the screen

Example Result

Example1


Style banner


Nevu UI status at the moment.

Layouts (Layout_Type Heirs)

(✅ - done, ❌ - not done, 💾 - deprecated and not working)

  • Grid
  • Row
  • Column
  • ScrollableRow
  • ScrollableColumn
  • ColorPicker
  • 💾 Pages
  • 💾 Gallery_Pages
  • StackColumn
  • StackRow
  • CheckBoxGroup
  • Panel

Widgets (Widget Heirs)

  • Widget
  • Button
  • Label
  • Input
  • EmptyWidget
  • Tooltip (Pygame exclusive, for now)
  • 💾 Gif
  • MusicPlayer (Will be reworked, i guess?)
  • ProgressBar
  • SliderBar
  • ElementSwitcher
  • 💾 FileDialog
  • RectCheckBox
  • Switch

Available Backends

  • Pygame-ce
  • Pygame-ce._sdl2(Sdl)
  • RayLib

Backend Exclusives

  • Ripple effect - Raylib exclusive
  • Transparent colors inside Gradient - Raylib exclusive
  • Customizable center and angle of the gradient - Raylib exclusive
  • Tooltip - Pygame exclusive

Style banner


Nevu UI is protected by the MIT license


Style banner


Nevu UI is NOT a stable framework, you may encounter many bugs in it.

If you found a bug, please report it in the Issues section


Style banner


Gmail: bebrovgolem@gmail.com

Creator: Nikita A.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

nevu_ui-0.8.1-cp314-cp314t-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.8.1-cp314-cp314t-musllinux_1_2_x86_64.whl (9.7 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

nevu_ui-0.8.1-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

nevu_ui-0.8.1-cp314-cp314-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.8.1-cp314-cp314-musllinux_1_2_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

nevu_ui-0.8.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

nevu_ui-0.8.1-cp313-cp313-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.8.1-cp313-cp313-musllinux_1_2_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

nevu_ui-0.8.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

nevu_ui-0.8.1-cp312-cp312-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.8.1-cp312-cp312-musllinux_1_2_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

nevu_ui-0.8.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file nevu_ui-0.8.1-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.8.1-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nevu_ui-0.8.1-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 dc3ca002c1633223a0df0189f60ee40e9a61c86d80a62866bdaae05ad8d0f665
MD5 2f96fc5cfc2e2539252f3986228b5e5b
BLAKE2b-256 fd92561b5a73cf70d7f8dad9e97d80c45ed6863ebe723b054988519ae9e68c1b

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.1-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6c7f89d2c65a31001af884677d1219f60478895c4b50bfc8650ea7cc22ac3ec3
MD5 f2439da50d8999debd3981a6c1ffa961
BLAKE2b-256 76ee00d5848edfb5c834fae68a2f37b6087c3b0614f33c1792e07f006dd1c329

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.1-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7c2b5f596845a44650a00e5393d94d9cdba98264e285930ef27490b5d98038dc
MD5 28a09f05f24e473e121690dd501d84ca
BLAKE2b-256 0e3debb1706dcf7969806d0fa2e0660bd76b3adcb0d2e84deaafd2c8545c3cf8

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.8.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nevu_ui-0.8.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 152309d2726f22824d9119830ace313647fef5f450374f2641cf80b3d6f7dace
MD5 670e738710a9c71519b79bf663e722ea
BLAKE2b-256 3dd5d5bb525734a36ed08d0d9b9df8cb67e81a6d7c24a74e661351ca13c1682a

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.1-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7497588101fef173d95c842ca82c2e31df67b59b74cec01099489ebef2cdd363
MD5 7a720a7df8fff646cbc12fb6b7135511
BLAKE2b-256 4518e2c4d518f4303f73afb44ab88dcf847733c669952f9343c8d65e2b81b95d

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5e418141a7a3bfda1a8588a2e9ae8e7261461504f8006bf7bf8f9319934d8034
MD5 067bae1e729e2325255232b40e0730fc
BLAKE2b-256 a8f1102cbe75ec2988328d65d437f7fd52d3e2749bc413b7215165329013b9fa

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.8.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nevu_ui-0.8.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0b7f5aa312562e88986fde382278abd4e0de7cf5a4283ce549f7e1a4ed789044
MD5 ee828ec9e0433a12a9b10ea799526b7f
BLAKE2b-256 757e09cc4242e8dbba9b73a75b5c6e5c713e8325e8edf8bf23b089ba4eedfb85

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b8e3df67a19ccfe82037d02086ddda722a130973d93db872ed0e8bd4a8c5cb37
MD5 a77a9396a91b7d5a5c71595a765d2b8b
BLAKE2b-256 7103835ebb3c94c881195ac9c009c055a65bff6afebf96ea6cc1e09e90a7a266

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e017860dc8001fd410603bae4ef7bd681910760296c18500aa22485028129967
MD5 2a012e67b3bef0d022752539b20ebc07
BLAKE2b-256 5901c51c0c5342a79cfb1b677639e424d7565ba59af685c6894353ab5036d55e

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.8.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nevu_ui-0.8.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f262b51faffd9295bd2e22d487b5e4becd2fa2f3a3017c58dda7a0fdffafbc8b
MD5 6561bd25d36750b88a3a80d4b9c5a4b3
BLAKE2b-256 5e8a303c28a70aef3b58628ada7d762aea1fd5e53de793c9a308dea3f42c88ca

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4b4f273bd70487499ff241abc50af9b7cbed5a3acf6530ba75194979c32ad773
MD5 b7ac04db26acd89ac987b1751fdd7b49
BLAKE2b-256 44531012579fa9aa36cdcff36db075e595bc0da1e1af05050cc1d0159f30d14d

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4098c96c6a3cf40d2fb14f5f391bba77339500d09337a682d8d76923d9552de3
MD5 259b129d0fc1c080ef87f665ce10992f
BLAKE2b-256 5acfcc02d91a35c5d81ece72f2a4f429a693ca3ce6649d05a1009f249b41d5e7

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