Skip to content

romainfrancois/htmltools

This branch is 52 commits behind rstudio/htmltools:main.

Folders and files

NameName
Last commit message
Last commit date
Nov 19, 2021
Aug 3, 2022
May 13, 2021
Aug 3, 2022
May 19, 2021
Jul 18, 2022
Jul 19, 2021
Jun 16, 2020
Apr 1, 2022
Dec 15, 2021
May 13, 2021
Apr 15, 2021
Apr 25, 2018
Aug 3, 2022
Jul 8, 2021
Aug 3, 2022
Jul 18, 2022
Apr 7, 2014

Repository files navigation

R build status CRAN status Lifecycle: experimental

htmltools

Tools for creating, manipulating, and writing HTML from R.

Installation

Install the stable release of htmltools on CRAN:

install.packages("htmltools")

Install the development version with:

remotes::install_github("rstudio/htmltools")

Quick overview

{htmltools} makes it easy to customize the user interface (UI) of any Shiny or R Markdown project by using R code to generate custom HTML (including JavaScript and CSS).

This Shiny article provides a great introduction to {htmltools} (even if you're not interested in Shiny). As you'll learn in that article, the general foundation that {htmltools} provides allows other R packages (e.g., {htmlwidgets}, {crosstalk}, etc.) to provide "HTML components" in R that users can manipulate and combine in ways the component authors didn't foresee.

For example, as described in depth here, {htmltools} makes it fairly easy to arrange numerous {htmlwidgets} (e.g., {plotly} graphs) into a single static HTML webpage:

library(htmltools)
browsable(tagList(
  plot_ly(diamonds, x = ~carat, height = 200),
  plot_ly(diamonds, x = ~price, height = 200)
))

Also, thanks to tagQuery(), it is fairly easy to query and manipulate the underlying HTML structure of components. See the tagQuery() article to learn more.

Learn more

If you're looking to learn how to build more custom user interfaces by writing custom HTML/JavaScript/CSS, we recommend the following resource:

About

Tools for HTML generation and output

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 98.0%
  • C 1.9%
  • HTML 0.1%