Metadata-Version: 2.5
Name: trame-mui
Version: 1.0.0
Summary: MUI (React) widgets for trame
Author: Kitware Inc.
License: MIT
License-File: LICENSE
Keywords: Application,Framework,Interactive,Python,React,Web
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: trame-client<5,>=4
Requires-Dist: trame-server<5,>=3.15
Provides-Extra: dev
Requires-Dist: nox; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: test
Requires-Dist: pillow; extra == 'test'
Requires-Dist: pixelmatch; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-asyncio; extra == 'test'
Requires-Dist: pytest-playwright; extra == 'test'
Requires-Dist: pytest-xprocess; extra == 'test'
Requires-Dist: trame; extra == 'test'
Description-Content-Type: text/x-rst

trame-mui: MUI (React) widgets for trame
=============================================

trame-mui is the React equivalent of `trame-vuetify
<https://github.com/Kitware/trame-vuetify>`_: it wraps `MUI
<https://mui.com/>`_ (Material Design components for React, the direct analog
of Vuetify for Vue) for `trame <https://kitware.github.io/trame/>`_
applications running with ``client_type="react"`` (the native React client
that ships with trame-client).

.. code-block:: python

    from trame.app import get_server
    from trame.widgets import mui

    server = get_server(client_type="react")

Not to be confused with `trame-react
<https://github.com/Kitware/trame-react>`_, which embeds a Vue-rendered trame
application inside a React application through an iframe.

.. image:: https://raw.githubusercontent.com/Kitware/trame-mui/refs/heads/master/trame-mui.png
  :alt: Illustration of what can be done with trame and mui


Layout (mirrors trame-vuetify)
------------------------------

* ``react-components/`` - React components + ``install(registry)`` plugin,
  bundled with React as an external, and the Python class generator
* ``src/trame_mui/module/`` - module descriptor (``serve``/``scripts``/
  ``styles``/``react_use``) consumed by ``server.enable_module()``
* ``src/trame_mui/widgets/`` - generated Python widget classes

Development
------------------------------

Build and install the Vue components

.. code-block:: sh

    cd react-components
    npm i
    npm run build
    cd -

Install the library

.. code-block:: sh

    # Create venv and install all dependencies
    uv sync --all-extras --dev

    # Activate environment
    source .venv/bin/activate

    # Install commit analysis
    pre-commit install
    pre-commit install --hook-type commit-msg


License
-------

trame-mui is made available under the MIT License.
