Skip to content
HTML Widgets for R
R JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
R Add shim for system.file to work with devtools-loaded packages (#340) Aug 5, 2019
inst Try evaling js code client-side both with and without parentheses (#332) Mar 13, 2019
vignettes update link to JS docs Apr 26, 2018
.Rbuildignore additional work on docs and other things required to pass R CMD check Dec 3, 2014
.gitignore initial commit Jul 17, 2014
DESCRIPTION bump version (#335) Apr 10, 2019
NAMESPACE Fix typo in link in Apr 13, 2019
htmlwidgets.Rproj Bump metadata (#322) Oct 25, 2018

HTML Widgets for R

The htmlwidgets package provides a framework for easily creating R bindings to JavaScript libraries. Widgets created using the framework can be:

  • Used at the R console for data analysis just like conventional R plots (via RStudio Viewer).
  • Seamlessly embedded within R Markdown documents and Shiny web applications.
  • Saved as standalone web pages for ad-hoc sharing via email, Dropbox, etc.

There are already several R packages based on htmlwidgets, including:

  • leaflet -- Interactive maps with OpenStreetMap
  • dygraphs --- Interactive time series visualization
  • networkD3 --- Network visualization with D3
  • sparkline --- Small inline charts
  • DT --- Tabular data via DataTables
  • rthreejs -- Interactive 3D graphics

The package was created in collaboration by Ramnath Vaidyanathan, Joe Cheng, JJ Allaire, Yihui Xie, and Kenton Russell. We've all spent countless hours building bindings between R and the web, and were motivated to create a framework that made this as easy as possible for all R developers.

Getting Started

If you know R and a bit of JavaScript it's very straightforward to create your own widgets. You can install the htmlwidgets package from CRAN:


You can alternatively install the development version of htmlwidgets from GitHub as follows:


There are several articles on the htmlwidgets website that will help you get you off the ground quickly and take advantage of all of the capabilities of the framework:

You can’t perform that action at this time.