Skip to content

Commit

Permalink
Merge branch 'main' of github.com:napari/npe2 into pre-commit-ci-upda…
Browse files Browse the repository at this point in the history
…te-config
  • Loading branch information
brisvag committed Apr 5, 2024
2 parents 5591658 + 636969a commit 4fb2750
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions _docs/templates/_npe2_widgets_guide.md.jinja
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
(widgets-contribution-guide)=
## Widgets

Widget plugins allow developers to contribute novel graphical
elements (aka "widgets") to the user interface. These widgets can request
Widget plugin contributions allow developers to add novel graphical
elements (aka "widgets") to the user interface. For a full introduction to
creating `napari` widgets see [](creating-widgets).

Widgets can request
access to the viewer instance in which they are docked, enabling a broad
range of functionality: essentially, anything that can be done with the
napari `Viewer` and `Layer` APIs can be accomplished with widgets.
Expand Down Expand Up @@ -58,6 +61,16 @@ specification:
hook specification. In the new `npe2` pattern, one uses the `autogenerate`
field in the [WidgetContribution](contributions-widgets).

For more examples see [](creating-widgets) and
[GUI gallery examples](https://napari.org/stable/_tags/gui.html) (only a subset
involve widgets). Additionally,
[cookiecutter-napari-plugin](https://github.com/napari/cookiecutter-napari-plugin)
has more robust widget examples that you can adapt to your needs.

```{note}
Notice that `napari` type annotations are strings and not imported. This is to
avoid including `napari` as a plugin dependency when not strictly required.
```

### Widget example

Expand Down

0 comments on commit 4fb2750

Please sign in to comment.