👻 A simple example widget

A simple example which you can use as a template for creating your own widget. Takes two optional parameters (text and count), and fetches a list of images from dummyapis.com, and renders the results to the UI.
This commit is contained in:
Alicia Sykes
2021-12-14 19:02:45 +00:00
parent 6df95c9387
commit 3da76ce299
4 changed files with 152 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ Dashy has support for displaying dynamic content in the form of widgets. There a
- [Stock Price History](#stock-price-history)
- [Joke of the Day](#joke)
- [Flight Data](#flight-data)
- [Example Widget](#example-widget)
- [Self-Hosted Services Widgets](#dynamic-widgets)
- [Dynamic Widgets](#dynamic-widgets)
- [Iframe Widget](#iframe-widget)
@@ -366,6 +367,30 @@ Displays airport departure and arrival flights, using data from [AeroDataBox](ht
---
### Example Widget
A simple example widget, to use as a template. Fetches and displays a list of images, from [Dummy APIs](https://dummyapis.com/).
<p align="center"><img width="400" src="https://i.ibb.co/VSPn84t/example-widget.png" /></p>
##### Options
**Field** | **Type** | **Required** | **Description**
--- | --- | --- | ---
**`text`** | `string` | _Optional_ | Text to display in the images. Defaults to `Dashy`
**`count`** | `number` | _Optional_ | The number of images to be rendered. Defaults to `5`
##### Example
```yaml
- type: example
options:
text: Hello
count: 3
```
---
## Dynamic Widgets
### Iframe Widget