Skip to content

Commit 7629135

Browse files
committed
Add data-menu-button-contents example
1 parent 00b72d2 commit 7629135

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import '@github/details-menu-element'
2525
</details>
2626
```
2727

28-
Use `data-menu-button` and `data-menu-button-text` to have button text updated on menu item activation.
28+
Use `data-menu-button` and `data-menu-button-text` to update the button's text on menu item activation.
2929

3030
```html
3131
<details>
@@ -38,6 +38,19 @@ Use `data-menu-button` and `data-menu-button-text` to have button text updated o
3838
</details>
3939
```
4040

41+
Use `data-menu-button` and `data-menu-button-contents` to update the button's HTML content on menu item activation.
42+
43+
```html
44+
<details>
45+
<summary>Preferred robot: <span data-menu-button>None</span></summary>
46+
<details-menu role="menu">
47+
<button type="button" role="menuitem" data-menu-button-contents><img src="hubot.png"> Hubot</button>
48+
<button type="button" role="menuitem" data-menu-button-contents><img src="bender.png"> Bender</button>
49+
<button type="button" role="menuitem" data-menu-button-contents><img src="bb8.png"> BB-8</button>
50+
</details-menu>
51+
</details>
52+
```
53+
4154
Use `label[tabindex="0"][role=menuitemradio/menuitemcheckbox]` when dealing with radio and checkbox inputs menu items. Check states of the input element and the label will be synchronized.
4255

4356
```html

0 commit comments

Comments
 (0)