Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 10, 2021
1 parent 0958b0d commit 3219a03
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions examples/user_guide/Customization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,45 @@
" pn.Column(pn.widgets.Button(name='Run', margin=(25, 50, 75, 100)), background='#f0f0f0'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## ``align``\n",
"\n",
"The `align` parameter controls how components align vertically and horizontally. It supports 'start', 'center', and 'end' values and can be set for both horizontal and vertical directions at once or for each separately by passing in a tuple of the form `(horizontal, vertical)`.\n",
"\n",
"One common use-case where alignment is important is when placing multiple items with different heights in a `Row`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"pn.Row(pn.widgets.IntSlider(name='Test'), pn.widgets.IntSlider(align='end'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In a grid you may also have to specify the horizontal and vertical alignment separately to achieve the layout you are after:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"pn.GridBox(\n",
" pn.widgets.IntSlider(name='Test'), pn.widgets.IntSlider(align='end'),\n",
" pn.widgets.TextInput(name='Test', width=150), pn.widgets.TextInput(width=150, align=('start', 'end')),\n",
" ncols=2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 3219a03

Please sign in to comment.