Skip to content

Commit

Permalink
add section about custom components to the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Aug 12, 2024
1 parent b48bbe3 commit 5236031
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions website/documentation/content/section_configuration_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ def env_var_demo():
ui.label(f'Markdown content cache size is {markdown.prepare_content.cache_info().maxsize}')


doc.text('Custom Vue Components', '''
You can create custom components by subclassing `ui.element` and implementing a corresponding Vue component.
The ["Custom Vue components" example](https://github.com/zauberzeug/nicegui/tree/main/examples/custom_vue_component)
demonstrates how to create a custom counter component which emits events and receives updates from the server.
The ["Signature pad" example](https://github.com/zauberzeug/nicegui/blob/main/examples/signature_pad)
shows how to define dependencies for a custom component using a `package.json` file.
This allows you to use third-party libraries via NPM in your component.
Last but not least, the ["Node module integration" example](https://github.com/zauberzeug/nicegui/blob/main/examples/node_module_integration)
demonstrates how to create a package.json file and a webpack.config.js file to bundle a custom Vue component with its dependencies.
''')

doc.text('Server Hosting', '''
To deploy your NiceGUI app on a server, you will need to execute your `main.py` (or whichever file contains your `ui.run(...)`) on your cloud infrastructure.
You can, for example, just install the [NiceGUI python package via pip](https://pypi.org/project/nicegui/) and use systemd or similar service to start the main script.
Expand Down

0 comments on commit 5236031

Please sign in to comment.