mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-29 03:00:45 -04:00
215 lines
16 KiB
HTML
215 lines
16 KiB
HTML
<!DOCTYPE html>
|
|
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Create a page that fills the window — fillPage • shiny</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Create a page that fills the window — fillPage"><meta property="og:description" content="fillPage creates a page whose height and width always fill the
|
|
available area of the browser window."><meta property="og:image" content="/logo.png"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
|
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
|
<![endif]--></head><body data-spy="scroll" data-target="#toc">
|
|
|
|
|
|
<div class="container template-reference-topic">
|
|
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<span class="navbar-brand">
|
|
<a class="navbar-link" href="../index.html">shiny</a>
|
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">1.7.2.9000</span>
|
|
</span>
|
|
</div>
|
|
|
|
<div id="navbar" class="navbar-collapse collapse">
|
|
<ul class="nav navbar-nav"><li>
|
|
<a href="../reference/index.html">Reference</a>
|
|
</li>
|
|
<li>
|
|
<a href="../news/index.html">Changelog</a>
|
|
</li>
|
|
</ul><ul class="nav navbar-nav navbar-right"><li>
|
|
<a href="https://github.com/rstudio/shiny/" class="external-link">
|
|
<span class="fab fa-github fa-lg"></span>
|
|
|
|
</a>
|
|
</li>
|
|
</ul></div><!--/.nav-collapse -->
|
|
</div><!--/.container -->
|
|
</div><!--/.navbar -->
|
|
|
|
|
|
|
|
</header><div class="row">
|
|
<div class="col-md-9 contents">
|
|
<div class="page-header">
|
|
<h1>Create a page that fills the window</h1>
|
|
<small class="dont-index">Source: <a href="https://github.com/rstudio/shiny/blob/HEAD/R/bootstrap.R" class="external-link"><code>R/bootstrap.R</code></a></small>
|
|
<div class="hidden name"><code>fillPage.Rd</code></div>
|
|
</div>
|
|
|
|
<div class="ref-description">
|
|
<p><code>fillPage</code> creates a page whose height and width always fill the
|
|
available area of the browser window.</p>
|
|
</div>
|
|
|
|
<div id="ref-usage">
|
|
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">fillPage</span><span class="op">(</span></span>
|
|
<span> <span class="va">...</span>,</span>
|
|
<span> padding <span class="op">=</span> <span class="fl">0</span>,</span>
|
|
<span> title <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
|
<span> bootstrap <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
|
<span> theme <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
|
<span> lang <span class="op">=</span> <span class="cn">NULL</span></span>
|
|
<span><span class="op">)</span></span></code></pre></div>
|
|
</div>
|
|
|
|
<div id="arguments">
|
|
<h2>Arguments</h2>
|
|
<dl><dt>...</dt>
|
|
<dd><p>Elements to include within the page.</p></dd>
|
|
|
|
|
|
<dt>padding</dt>
|
|
<dd><p>Padding to use for the body. This can be a numeric vector
|
|
(which will be interpreted as pixels) or a character vector with valid CSS
|
|
lengths. The length can be between one and four. If one, then that value
|
|
will be used for all four sides. If two, then the first value will be used
|
|
for the top and bottom, while the second value will be used for left and
|
|
right. If three, then the first will be used for top, the second will be
|
|
left and right, and the third will be bottom. If four, then the values will
|
|
be interpreted as top, right, bottom, and left respectively.</p></dd>
|
|
|
|
|
|
<dt>title</dt>
|
|
<dd><p>The title to use for the browser window/tab (it will not be
|
|
shown in the document).</p></dd>
|
|
|
|
|
|
<dt>bootstrap</dt>
|
|
<dd><p>If <code>TRUE</code>, load the Bootstrap CSS library.</p></dd>
|
|
|
|
|
|
<dt>theme</dt>
|
|
<dd><p>One of the following:</p><ul><li><p><code>NULL</code> (the default), which implies a "stock" build of Bootstrap 3.</p></li>
|
|
<li><p>A <code><a href="https://rstudio.github.io/bslib/reference/bs_theme.html" class="external-link">bslib::bs_theme()</a></code> object. This can be used to replace a stock
|
|
build of Bootstrap 3 with a customized version of Bootstrap 3 or higher.</p></li>
|
|
<li><p>A character string pointing to an alternative Bootstrap stylesheet
|
|
(normally a css file within the www directory, e.g. <code>www/bootstrap.css</code>).</p></li>
|
|
</ul></dd>
|
|
|
|
|
|
<dt>lang</dt>
|
|
<dd><p>ISO 639-1 language code for the HTML page, such as "en" or "ko".
|
|
This will be used as the lang in the <code><html></code> tag, as in <code><html lang="en"></code>.
|
|
The default (NULL) results in an empty string.</p></dd>
|
|
|
|
</dl></div>
|
|
<div id="details">
|
|
<h2>Details</h2>
|
|
<p>The <code><a href="fluidPage.html">fluidPage()</a></code> and <code><a href="fixedPage.html">fixedPage()</a></code> functions are used
|
|
for creating web pages that are laid out from the top down, leaving
|
|
whitespace at the bottom if the page content's height is smaller than the
|
|
browser window, and scrolling if the content is larger than the window.</p>
|
|
<p><code>fillPage</code> is designed to latch the document body's size to the size of
|
|
the window. This makes it possible to fill it with content that also scales
|
|
to the size of the window.</p>
|
|
<p>For example, <code>fluidPage(plotOutput("plot", height = "100%"))</code> will not
|
|
work as expected; the plot element's effective height will be <code>0</code>,
|
|
because the plot's containing elements (<code><div></code> and <code><body></code>) have
|
|
<em>automatic</em> height; that is, they determine their own height based on
|
|
the height of their contained elements. However,
|
|
<code>fillPage(plotOutput("plot", height = "100%"))</code> will work because
|
|
<code>fillPage</code> fixes the <code><body></code> height at 100% of the window height.</p>
|
|
<p>Note that <code>fillPage(plotOutput("plot"))</code> will not cause the plot to fill
|
|
the page. Like most Shiny output widgets, <code>plotOutput</code>'s default height
|
|
is a fixed number of pixels. You must explicitly set <code>height = "100%"</code>
|
|
if you want a plot (or htmlwidget, say) to fill its container.</p>
|
|
<p>One must be careful what layouts/panels/elements come between the
|
|
<code>fillPage</code> and the plots/widgets. Any container that has an automatic
|
|
height will cause children with <code>height = "100%"</code> to misbehave. Stick
|
|
to functions that are designed for fill layouts, such as the ones in this
|
|
package.</p>
|
|
</div>
|
|
<div id="see-also">
|
|
<h2>See also</h2>
|
|
<div class="dont-index"><p>Other layout functions:
|
|
<code><a href="fixedPage.html">fixedPage</a>()</code>,
|
|
<code><a href="flowLayout.html">flowLayout</a>()</code>,
|
|
<code><a href="fluidPage.html">fluidPage</a>()</code>,
|
|
<code><a href="navbarPage.html">navbarPage</a>()</code>,
|
|
<code><a href="sidebarLayout.html">sidebarLayout</a>()</code>,
|
|
<code><a href="splitLayout.html">splitLayout</a>()</code>,
|
|
<code><a href="verticalLayout.html">verticalLayout</a>()</code></p></div>
|
|
</div>
|
|
|
|
<div id="ref-examples">
|
|
<h2>Examples</h2>
|
|
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">fillPage</span><span class="op">(</span></span></span>
|
|
<span class="r-in"><span> <span class="va">tags</span><span class="op">$</span><span class="fu">style</span><span class="op">(</span>type <span class="op">=</span> <span class="st">"text/css"</span>,</span></span>
|
|
<span class="r-in"><span> <span class="st">".half-fill { width: 50%; height: 100%; }"</span>,</span></span>
|
|
<span class="r-in"><span> <span class="st">"#one { float: left; background-color: #ddddff; }"</span>,</span></span>
|
|
<span class="r-in"><span> <span class="st">"#two { float: right; background-color: #ccffcc; }"</span></span></span>
|
|
<span class="r-in"><span> <span class="op">)</span>,</span></span>
|
|
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/pkg/htmltools/man/builder.html" class="external-link">div</a></span><span class="op">(</span>id <span class="op">=</span> <span class="st">"one"</span>, class <span class="op">=</span> <span class="st">"half-fill"</span>,</span></span>
|
|
<span class="r-in"><span> <span class="st">"Left half"</span></span></span>
|
|
<span class="r-in"><span> <span class="op">)</span>,</span></span>
|
|
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/pkg/htmltools/man/builder.html" class="external-link">div</a></span><span class="op">(</span>id <span class="op">=</span> <span class="st">"two"</span>, class <span class="op">=</span> <span class="st">"half-fill"</span>,</span></span>
|
|
<span class="r-in"><span> <span class="st">"Right half"</span></span></span>
|
|
<span class="r-in"><span> <span class="op">)</span>,</span></span>
|
|
<span class="r-in"><span> padding <span class="op">=</span> <span class="fl">10</span></span></span>
|
|
<span class="r-in"><span><span class="op">)</span></span></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> <style type="text/css"></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> .half-fill { width: 50%; height: 100%; }</span>
|
|
<span class="r-out co"><span class="r-pr">#></span> #one { float: left; background-color: #ddddff; }</span>
|
|
<span class="r-out co"><span class="r-pr">#></span> #two { float: right; background-color: #ccffcc; }</span>
|
|
<span class="r-out co"><span class="r-pr">#></span> </style></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> <div id="one" class="half-fill">Left half</div></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> <div id="two" class="half-fill">Right half</div></span>
|
|
<span class="r-in"><span></span></span>
|
|
<span class="r-in"><span><span class="fu">fillPage</span><span class="op">(</span></span></span>
|
|
<span class="r-in"><span> <span class="fu"><a href="fillRow.html">fillRow</a></span><span class="op">(</span></span></span>
|
|
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/pkg/htmltools/man/builder.html" class="external-link">div</a></span><span class="op">(</span>style <span class="op">=</span> <span class="st">"background-color: red; width: 100%; height: 100%;"</span><span class="op">)</span>,</span></span>
|
|
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/pkg/htmltools/man/builder.html" class="external-link">div</a></span><span class="op">(</span>style <span class="op">=</span> <span class="st">"background-color: blue; width: 100%; height: 100%;"</span><span class="op">)</span></span></span>
|
|
<span class="r-in"><span> <span class="op">)</span></span></span>
|
|
<span class="r-in"><span><span class="op">)</span></span></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> <div class="flexfill-container flexfill-container-row" style="display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;width:100%;height:100%;"></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> <div class="flexfill-item" style="position:relative;-webkit-flex:1;-ms-flex:1;flex:1;width:100%;height:100%;"></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> <div class="flexfill-item-inner" style="position:absolute;top:0;left:0;right:0;bottom:0;"></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> <div style="background-color: red; width: 100%; height: 100%;"></div></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> </div></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> </div></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> <div class="flexfill-item" style="position:relative;-webkit-flex:1;-ms-flex:1;flex:1;width:100%;height:100%;"></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> <div class="flexfill-item-inner" style="position:absolute;top:0;left:0;right:0;bottom:0;"></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> <div style="background-color: blue; width: 100%; height: 100%;"></div></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> </div></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> </div></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> </div></span>
|
|
</code></pre></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
|
|
<nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2>
|
|
</nav></div>
|
|
</div>
|
|
|
|
|
|
<footer><div class="copyright">
|
|
<p></p><p>Developed by Winston Chang, Joe Cheng, JJ Allaire, Carson Sievert, Barret Schloerke, Yihui Xie, Jeff Allen, Jonathan McPherson, Alan Dipert, Barbara Borges.</p>
|
|
</div>
|
|
|
|
<div class="pkgdown">
|
|
<p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
|
|
</div>
|
|
|
|
</footer></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body></html>
|
|
|