Skip to main content

Components for DPG

Project description

dpg-components

"A component is a piece of the UI (user interface) that has its own logic and appearance. A component can be as small as a button, or as large as an entire page." Components are a powerful abstraction.

The goal of this project is to bring Components to DearPyGui

  • Components should be first class citizens, i.e. use the same API as regular DPG Items.
  • Components can contain other Components or regular DPG Items.
  • Reusability is achieved through composition.

How it works ?

Import module dpg_components, then you can interact with DPG as normal and also call the method "add_component" to add complex components to your project. You can also define your own components by implementing abstract class "DPGComponent".

from datetime import datetime
import dpg_components
import dearpygui.dearpygui as dpg

def save_callback():
    print("Save Clicked")

dpg.create_context()
dpg.create_viewport()
dpg.setup_dearpygui()

with dpg.window(label="Example Window"):
    dpg.add_text("Hello world")
    dpg.add_button(label="Save", callback=save_callback)
    dpg.add_input_text(label="string")
    dpg.add_slider_float(label="float")

    ## add a Date Picker component
    dpg.add_component(dpg_components.DatePickerComp, tag=f'date_picker_1')
    # Set default date to today
    dpg.configure_item(f'date_picker_1', default_value = datetime.now().date())

dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

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

dpgcomponents-0.0.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

dpgcomponents-0.0.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file dpgcomponents-0.0.1.tar.gz.

File metadata

  • Download URL: dpgcomponents-0.0.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for dpgcomponents-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0535afd5a0922ac29e0e5a8a9d2679b89c1c327048be62a737616fc9e17cf188
MD5 b7b6bc36a767d7bc7e3a7f1b1adae112
BLAKE2b-256 d0cae82ce45360c4514380a8b6ef772b862f26b8cbf72e7195fff921476fe931

See more details on using hashes here.

File details

Details for the file dpgcomponents-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: dpgcomponents-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for dpgcomponents-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 34c01e8ec45f097a1e282f1ec4623e38f2d0f841abc802b221e9d0d35aa66aad
MD5 3c313d2c720d3928061e477f3cf146be
BLAKE2b-256 f553490d021beb0e209144bd71ec7c09468517dbd3f9c3a328f6cec9295a032c

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