Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it very clear that emojis can be used as icons with Buttons #5926

Merged
merged 4 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/reference/widgets/Button.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"source": [
"### Icons\n",
"\n",
"The ``Button`` name string may contain Unicode characters, providing a convenient way to define common graphical buttons:"
"The ``Button`` name string may contain Unicode and Emoji characters, providing a convenient way to define common graphical buttons:"
]
},
{
Expand All @@ -175,8 +175,10 @@
"backward = pn.widgets.Button(name='\\u25c0', width=50)\n",
"forward = pn.widgets.Button(name='\\u25b6', width=50)\n",
"search = pn.widgets.Button(name='🔍', width=100)\n",
"save = pn.widgets.Button(name=\"💾 Save\", width=100)\n",
"copy = pn.widgets.Button(name=\"Copy ✂️\", width=100)\n",
"\n",
"pn.Row(backward, forward, search)"
"pn.Row(backward, forward, search, save, copy)"
]
},
{
Expand Down
22 changes: 22 additions & 0 deletions examples/reference/widgets/Toggle.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,28 @@
"source": [
"### Icons\n",
"\n",
"The `Toggle` name string may contain Unicode and Emoji characters, providing a convenient way to define common graphical buttons."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"backward = pn.widgets.Toggle(name='\\u25c0', width=50)\n",
"forward = pn.widgets.Toggle(name='\\u25b6', width=50)\n",
"search = pn.widgets.Button(name='🔍', width=100)\n",
"play = pn.widgets.Toggle(name=\"▶️ Play\", width=100)\n",
"pause = pn.widgets.Toggle(name=\"Pause ⏸️\", width=100)\n",
"\n",
"pn.Row(backward, forward, search, play, pause)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"However you can also provide an explicit `icon`, either as a named icon loaded from [tabler-icons.io](https://tabler-icons.io)/:"
]
},
Expand Down