Skip to content

Commit 3ecb2af

Browse files
committed
Adding examples to the example doc how to change the size of the dropdown/radiobuttons.
1 parent 1a7bc57 commit 3ecb2af

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

docs/source/examples/Widget List.ipynb

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,12 +537,34 @@
537537
"source": [
538538
"widgets.RadioButtons(\n",
539539
" options=['pepperoni', 'pineapple', 'anchovies'],\n",
540-
"# value='pineapple',\n",
540+
"# value='pineapple', # Defaults to 'pineapple'\n",
541+
"# layout={'width': 'max-content'}, # If the items' names are long\n",
541542
" description='Pizza topping:',\n",
542543
" disabled=False\n",
543544
")"
544545
]
545546
},
547+
{
548+
"cell_type": "markdown",
549+
"metadata": {},
550+
"source": [
551+
"#### With dynamic layout, no width restriction"
552+
]
553+
},
554+
{
555+
"cell_type": "code",
556+
"execution_count": null,
557+
"metadata": {},
558+
"outputs": [],
559+
"source": [
560+
"Box(\n",
561+
" [\n",
562+
" Label(value='Pizza topping with a very long label:'), \n",
563+
" widgets.RadioButtons(options=['pepperoni', 'pineapple', 'anchovies', 'and the long name that will fit fine'])\n",
564+
" ]\n",
565+
")"
566+
]
567+
},
546568
{
547569
"cell_type": "markdown",
548570
"metadata": {
@@ -1339,7 +1361,7 @@
13391361
"name": "python",
13401362
"nbconvert_exporter": "python",
13411363
"pygments_lexer": "ipython3",
1342-
"version": "3.6.4"
1364+
"version": "3.7.6"
13431365
}
13441366
},
13451367
"nbformat": 4,

0 commit comments

Comments
 (0)