You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/content/components/popover.mdx
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,6 +153,38 @@ Use the `focus` trigger to dismiss popovers on the user's next click of a differ
153
153
</CPopover>
154
154
```
155
155
156
+
## Usage
157
+
158
+
### Disabled elements
159
+
160
+
Elements with the disabled attribute aren't interactive, meaning users cannot hover or click them to trigger a popover (or tooltip). As a workaround, you'll want to trigger the popover from a wrapper `<div>` or `<span>`, ideally made keyboard-focusable using `tabindex="0"`.
161
+
162
+
For disabled popover triggers, you may also prefer `trigger={['hover', 'focus']}` so that the popover appears as immediate visual feedback to your users as they may not expect to click on a disabled element.
Copy file name to clipboardExpand all lines: packages/docs/content/components/tooltip.mdx
+48-21Lines changed: 48 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,30 +109,57 @@ Hover over the buttons below to see the four tooltips directions: top, right, bo
109
109
</Example>
110
110
111
111
```jsx
112
+
<CTooltip
113
+
content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
114
+
placement="top"
115
+
>
116
+
<CButton color="secondary">Tooltip on top</CButton>
117
+
</CTooltip>
118
+
<CTooltip
119
+
content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
120
+
placement="right"
121
+
>
122
+
<CButton color="secondary">Tooltip on right</CButton>
123
+
</CTooltip>
124
+
<CTooltip
125
+
content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
126
+
placement="bottom"
127
+
>
128
+
<CButton color="secondary">Tooltip on bottom</CButton>
129
+
</CTooltip>
130
+
<CTooltip
131
+
content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
132
+
placement="left"
133
+
>
134
+
<CButton color="secondary">Tooltip on left</CButton>
135
+
</CTooltip>
136
+
```
137
+
138
+
## Usage
139
+
140
+
### Disabled elements
141
+
142
+
Elements with the disabled attribute aren’t interactive, meaning users cannot focus, hover, or click them to trigger a tooltip (or popover). As a workaround, you’ll want to trigger the tooltip from a wrapper `<div>` or `<span>`, ideally made keyboard-focusable using `tabindex="0"`.
143
+
144
+
<Example>
112
145
<CTooltip
113
-
content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
114
-
placement="top"
115
-
>
116
-
<CButton color="secondary">Tooltip on top</CButton>
117
-
</CTooltip>
118
-
<CTooltip
119
-
content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
120
-
placement="right"
121
-
>
122
-
<CButton color="secondary">Tooltip on right</CButton>
123
-
</CTooltip>
124
-
<CTooltip
125
-
content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
126
-
placement="bottom"
127
-
>
128
-
<CButton color="secondary">Tooltip on bottom</CButton>
129
-
</CTooltip>
130
-
<CTooltip
131
-
content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
132
-
placement="left"
146
+
content="Disabled tooltip"
147
+
trigger={['hover', 'focus']}
133
148
>
134
-
<CButton color="secondary">Tooltip on left</CButton>
0 commit comments