Skip to content

Commit 5553fff

Browse files
committed
Added info on widget as tooltip and widget builders for custom widget
1 parent a7885bc commit 5553fff

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

docs/ff-concepts/adding-customization/custom-widgets.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ this example, we will create a `ProductRatingBar` widget that uses a pub.dev dep
5757
</iframe>
5858
</div>
5959

60+
:::info[Widget Builder as Parameter]
61+
You can also leverage [**Widget Builders**](../../resources/ui/components/widget-builder-parameters.md) that allow you to pass in widgets to be used within the custom widget tree. This is especially useful when you want to dynamically substitute content for some part of a custom widget - like displaying an item in a custom widget popup.
62+
:::
63+
6064
### Properties: Width & Height
6165

6266
For custom widgets, it is mandatory to specify both width and height. These properties are required to size the custom widget appropriately. Without setting these dimensions, the custom widget will not render correctly within your application.

docs/resources/ui/widgets/built-in-widgets/tooltip.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ tags: [Base Elements]
44

55
# Tooltip
66

7-
The Tooltip widget provides a textual description of a widget in a small popup box. It appears when the user taps or long-presses the widget or hovers over it. It's typically used to provide an explanation about the function of a widget.
7+
The Tooltip widget provides additional information or visual cues of a widget in a small popup box. It appears when the user taps or long-presses the widget or hovers over it. It's typically used to provide an explanation about the function of a widget.
88

99
:::info
1010
It is not frequently used on touch devices where tapping or long-pressing can initiate other actions. But they can be incredibly useful in the desktop environment where hover functionality is available.
1111
:::
1212

1313
![tooltip.png](imgs/tooltip.png)
1414

15-
## Adding *Tooltip* widget
15+
## Adding Tooltip widget
1616

1717
To add the *Tooltip* widget to your app:
1818

@@ -51,6 +51,38 @@ Widget** and then select **Tooltip** widget.
5151
You can customize the appearance and behavior of this widget using the various properties
5252
available under the Properties Panel.
5353

54+
### Component as Tooltip
55+
56+
Sometimes, you may want to display more than just text in a tooltip—such as images, icons, buttons, or other custom components. For example, in an e-commerce app, a tooltip could show a detailed breakdown of customer reviews when users hover over the overall rating.
57+
58+
To achieve this, simply set the **Tooltip Type** to **Component** and select the custom component you'd like to display.
59+
60+
<div style={{
61+
position: 'relative',
62+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
63+
height: 0,
64+
width: '100%'}}>
65+
<iframe
66+
src="https://demo.arcade.software/jnFUZZQ9pmCH5vgvhVVA?embed&show_copy_link=true"
67+
title=""
68+
style={{
69+
position: 'absolute',
70+
top: 0,
71+
left: 0,
72+
width: '100%',
73+
height: '100%',
74+
colorScheme: 'light'
75+
}}
76+
frameborder="0"
77+
loading="lazy"
78+
webkitAllowFullScreen
79+
mozAllowFullScreen
80+
allowFullScreen
81+
allow="clipboard-write">
82+
</iframe>
83+
</div>
84+
<p></p>
85+
5486
### Change trigger mode
5587

5688
On touch devices, the *Tooltip* opens on tap. To make it open on long press instead, use the **Trigger Mode** property.

0 commit comments

Comments
 (0)