Path: blob/main/examples/how_to/custom/react/react_import_demo.py
2012 views
import param12import panel as pn34from panel.custom import Child, ReactComponent567class Example(ReactComponent):89child = Child()1011child2 = Child()1213color = param.Color()1415text = param.String()1617celebrate = param.Boolean()1819_esm = 'react_demo.js'2021_importmap = {22"imports": {23"@emotion/cache": "https://esm.sh/@emotion/cache",24"@emotion/react": "https://esm.sh/@emotion/[email protected]",25"@mui/material/": "https://esm.sh/@mui/[email protected]/",26"canvas-confetti": "https://esm.sh/[email protected]",27},28"scopes": {29}30}3132example = Example(text='Hello World!', child='Wow!')3334button = pn.widgets.Button(on_click=lambda e: example.param.update(child='Woo!'), name='Update')3536pn.Row(37pn.Param(example.param, parameters=['color', 'text', 'celebrate']),38example, button39).servable()404142