{"id":9272,"library":"reacton","title":"Reacton","description":"Reacton is a pure Python library that ports the declarative UI paradigm of React (JavaScript) to the ipywidgets ecosystem. It enables developers to build reusable and composable user interface components within Jupyter notebooks and web applications built with ipywidgets, by offering a declarative approach to state and UI management. It aims to simplify complex UI logic, reduce boilerplate, and enhance maintainability, serving as a foundation for frameworks like Solara. The current version is 1.9.1, with updates released on a feature-ready basis rather than a strict cadence.","status":"active","version":"1.9.1","language":"python","source_language":"en","source_url":"https://github.com/widgetti/reacton","tags":["ipywidgets","react","ui","declarative","jupyter","frontend","widgets"],"install":[{"cmd":"pip install reacton","lang":"bash","label":"Install Reacton"}],"dependencies":[{"reason":"Core dependency for UI rendering in Jupyter environments.","package":"ipywidgets","optional":false},{"reason":"Provides backported and experimental type hints.","package":"typing_extensions","optional":false}],"imports":[{"wrong":"import reacton\n@reacton.component","symbol":"component","correct":"from reacton import component"},{"wrong":"import reacton\nreacton.use_state","symbol":"use_state","correct":"from reacton import use_state"},{"wrong":"import reacton\nreacton.render","symbol":"render","correct":"from reacton import render"}],"quickstart":{"code":"import reacton\nimport reacton.ipywidgets as w\nfrom IPython.display import display\n\n@reacton.component\ndef ButtonClick():\n    clicks, set_clicks = reacton.use_state(0)\n\n    def my_click_handler():\n        set_clicks(clicks + 1)\n\n    button = w.Button(\n        description=f\"Clicked {clicks} times\",\n        on_click=my_click_handler\n    )\n    return button\n\ndisplay(ButtonClick())","lang":"python","description":"This example creates a simple button component that updates its click count using Reacton's `use_state` hook and a declarative approach to UI rendering within a Jupyter environment."},"warnings":[{"fix":"Ensure that arguments passed to widget constructors, especially when creating custom wrappers, precisely align with the widget's traitlets. If issues arise, consider opening an issue on the Reacton GitHub.","message":"When integrating with existing `ipywidgets` or custom widgets, Reacton assumes that widget constructor arguments match their underlying traits. Discrepancies can lead to runtime errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Prefer importing `reacton.ipywidgets as w` and using its wrapped components (e.g., `w.Button`) for better type safety, IDE support, and full integration with Reacton's lifecycle.","message":"Directly manipulating ipywidgets' elements via `ipywidgets.Widget.element(...)` bypasses Reacton's type-safe wrappers. This can lead to a less robust development experience, lacking type completion and static analysis.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Embrace Reacton's declarative paradigm by using `reacton.use_state` for local component state and other Reacton hooks for side effects and lifecycle management. Avoid directly modifying widget properties or adding/removing event handlers manually once a component is rendered.","message":"Attempting to manage UI state or event handlers imperatively (outside of Reacton's `use_state`, `use_effect`, etc.) can lead to inconsistent UI behavior, memory leaks, and difficult-to-debug issues, similar to common pitfalls in non-declarative UI frameworks.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.9.1':75 'aim':52 'applic':37 'approach':45 'basi':84 'boilerpl':59 'build':25 'built':38 'cadenc':89 'complex':55 'compon':31 'compos':28 'current':72 'declar':11,44,93 'develop':23 'ecosystem':20 'enabl':22 'enhanc':61 'featur':82 'feature-readi':81 'foundat':66 'framework':68 'frontend':95 'interfac':30 'ipywidget':19,40,90 'javascript':16 'jupyt':33,94 'librari':7 'like':69 'logic':57 'maintain':62 'manag':50 'notebook':34 'offer':42 'paradigm':13 'port':9 'pure':5 'python':6 'rather':85 'react':15,91 'reacton':1,2 'readi':83 'reduc':58 'releas':78 'reusabl':26 'serv':63 'simplifi':54 'solara':70 'state':47 'strict':88 'ui':12,49,56,92 'updat':77 'user':29 'version':73 'web':36 'widget':96 'within':32","created_at":"2026-04-16T18:49:21.760133+00:00","updated_at":"2026-04-16T18:49:21.760133+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.9.1","cli_name":"","cli_version":null,"type":"library","homepage":"https://reacton.readthedocs.org/","github":null,"docs":"https://reacton.solara.dev","changelog":null,"pypi":"https://pypi.org/project/reacton/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}