Tools for HTML

Tools for HTML generation and output.


htmltools 0.3.6

  • validateCssUnit() now accepts viewport units (vw, vh, vmin, vmax). (#56)

  • restorePreserveChunks() marks the output with the correct encoding now (UTF-8).

  • Length-0 attributes are now dropped, like NULLs. (#65)

  • Fixed #69: On Windows, renderDocument() did not mark output as UTF-8 if the head was UTF-8 but body was ASCII. (#71)

htmltools 0.3.5

  • as.character now returns a character vector with no other attributes. Previously it returned a character vector of class 'html'. (#31, #41)

  • htmlTemplate now can use a string as a template instead of requiring a file. (#41, #43)

  • HTML dependencies can now be added inline, instead of needing to use attachDependencies(). (#40, #42)

  • htmlDependency() gained a new argument all_files to indicate whether all files under the src directory should be copied when rendering dependencies, or only those specified in the dependency objects. (#48)

  • copyDependencyToDir() will always completely overwrite the target directory when copying HTML dependency files to make sure all dependency files are definitely updated in the target directory when the original dependency directory has been updated. In the past, the dependency files were not updated if they already existed. (#36)

  • The version number in the directory name of an HTML dependency can be suppressed by setting options(htmltools.dir.version = FALSE) when the dependency is copied via copyDependencyToDir(). (#37)

  • Performance improvement rendering tags, by switching from readLines to readChar.

htmltools 0.3

  • Add css function for conveniently forming CSS declaration strings.

  • Add template support, with the htmlTemplate(), renderDocument(), and suppressDependencies() functions.

htmltools 0.2.9

  • Add check that htmlDependency() isn't called with an absolute path when a binary package is built. (#22)

  • Allow HTML content to include UTF-8, Latin1, and system encoded content. All will be converted to UTF-8 using enc2utf8() at render time. (#21)

  • Add tagGetAttribute() and tagHasAttribute() functions.

htmltools 0.2.7

  • Add "append" parameter to attachDependencies, to allow adding dependencies, instead of replacing them.

htmltools 0.2.6

  • Add "attachment" parameter to htmlDependency, which can be used to allow any file in the dependency directory to be available via URL at runtime.

htmltools 0.2.5

  • Explicit library(htmltools) is no longer required for tags to be rendered in knitr/rmarkdown documents.

  • Added "viewer" parameter to html_print.

htmltools 0.2.4

Initial release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.5.2 by Carson Sievert, 2 months ago

Report a bug at

Browse source code at

Authors: Joe Cheng [aut] , Carson Sievert [aut, cre] , Barret Schloerke [aut] , Winston Chang [aut] , Yihui Xie [aut] , Jeff Allen [aut] , RStudio [cph]

Documentation:   PDF Manual  

Task views: Reproducible Research, Web Technologies and Services

GPL (>= 2) license

Imports utils, digest, grDevices, base64enc, rlang, fastmap

Suggests markdown, testthat, withr, Cairo, ragg, shiny

Enhances knitr

Imported by AovBay, BED, BETS, CALANGO, CNAIM, CaPO4Sim, DCEtool, DT, DWBmodelUN, DataEditR, DiagrammeR, FielDHub, GenEst, GeodesiCL, GomoGomonoMi, HARtools, Hmisc, JBrowseR, MDMAPR, NMproject, PRISMA2020, RagGrid, Rnightly, Rnvd3, SPARTAAS, XKCDdata, aceEditor, algo, aniview, antaresViz, aos, apexcharter, apisensr, argonDash, argonR, auth0, aweSOM, azuremlsdk, basictabler, bea.R, billboarder, bioacoustics, blastula, blogdown, bookdown, bs4Dash, bs4cards, bslib, bsplus, bubblyr, cascadess, chromoMap, clinDataReview, codebook, colourpicker, condformat, connectwidgets, corazon, corrgrapher, cronologia, crosstalk, cubeview, d3r, dash, dashboardthemes, data.validator, dataMaid, datacleanr, datadigest, datamods, daterangepicker, dccvalidator, deckgl, desctable, devtoolbox, dextergui, discoveR, distill, dlookr, documenter, downloadthis, dragon, drawer, dygraphs, echarts4r, echarty, emayili, eph, epiflows, esquisse, fabricerin, fdapaceShiny, flexdashboard, flextable, flipdownr, fontawesome, formattable, fresh, gfonts, ggiraph, ggvis, gitlink, gm, golem, googleway, gotop, gt, gwpcormapper, highcharter, hover, hrbrthemes, htmlTable, htmltidy, htmlwidgets, i2dash, inlmisc, jquerylib, jsTree, jsTreeR, kableExtra, keys, leafem, leafgl, leaflegend, leaflet, leaflet.esri, leaflet.extras, leaflet.extras2, leaflet.minicharts, leaflet.multiopacity, leaflet.opacity, leafletCN, leafpm, leafpop, leafsync, leaftime, learnr, listviewer, mailtoR, manifestoR, manipulateWidget, mapboxer, mapedit, mapping, mapview, metathis, metricsgraphics, mgwrsar, microplot, miniUI, minidown, mmaqshiny, monaco, mschart, mwshiny, naturaList, omsvg, oncrawlR, owidR, pagedown, palmid, papayar, phosphoricons, pivottabler, pixiedust, pkggraph, plainview, plotly, plumbertableau, pointblank, polished, ppcSpatial, predictoR, processanimateR, processmapR, questionr, r2d3, rAmCharts, rAmCharts4, radarchart, radix, rcrimeanalysis, reactR, reactable, reactablefmtr, recogito, regexTestR, regressoR, repr, rgl, rheroicons, rintimg, rmarkdown, rmdformats, rms, rock, rolldown, rtables, rwebstat, sass, savonliquide, scrollrevealR, semantic.dashboard, sergeant, sever, shiny, shiny.pwa, shiny.react, shiny.router, shiny.semantic, shinyBS, shinyChakraSlider, shinyChakraUI, shinyDND, shinyEffects, shinyFeedback, shinyFiles, shinyGovstyle, shinyHeatmaply, shinyKnobs, shinyMobile, shinyTime, shinyToastify, shinyWidgets, shinyaframe, shinyalert, shinybootstrap2, shinybusy, shinydashboard, shinydashboardPlus, shinydisconnect, shinydlplot, shinydrive, shinyglide, shinyjqui, shinyjs, shinylogs, shinymanager, shinymeta, shinypanel, shinypanels, shinypivottabler, shinyreforms, shinyservicebot, shinysurveys, shinyvalidate, sigmajs, simplevis, sketch, slickR, slideview, sortable, sparkline, spoiler, spsComps, summarytools, sunburstR, table1, tableHTML, tablerDash, tables, tangram, texPreview, timevis, tint, tippy, tmap, tosca, trackr, trelliscopejs, ttt, tufte, ufs, valhallr, vdiffr, vegalite, vegawidget, vembedr, vfinputs, visNetwork, vov, waiter, widgetframe, wpa, xaringan, yonder.

Depended on by SmarterPoland.

Suggested by CNVScope, ExPanDaR, FSelectorRcpp, LDAvis, NIMAA, ReviewR, RxODE, SDMtune, SimSurvey, VarSelLCM, ambiorix, animint2, antaresRead, bayesmove, behaviorchange, cli, clinUtils, colorDF, covr, cqcr, crunchy, dataquieR, dotdot, dpseg, expss, fastshap, flipr, fontquiver, gdtools, geofi, ggalluvial, gganimate, h2o, hystReet, iheatmapr, inTextSummaryTable, insee, ipumsr, leafdown, linne, netCoin, networkD3, opera, parcoords, parlitools, plotlyGeoAssets, polmineR, profvis, projmgr, qtlcharts, reactlog, rhandsontable, rpivotTable, rvg, segclust2d, shinyloadtest, stringr, svgPanZoom, svglite, tabr, tabxplor, thematic, thorn, tibble, uavRmp, ukpolice, unpivotr, ursa, vitae, xfun.

See at CRAN