Git Product home page Git Product logo

htmltools's Introduction

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:

htmltools's People

Contributors

atusy avatar cderv avatar colinfay avatar cpsievert avatar daattali avatar dmpe avatar dmurdoch avatar flrd avatar gadenbuie avatar gtritchie avatar hadley avatar haozhu233 avatar indrajeetpatil avatar jcheng5 avatar jimhester avatar jjallaire avatar jmcphers avatar maelle avatar mkuhn avatar nistara avatar ramnathv avatar rekado avatar romainfrancois avatar schloerke avatar shrektan avatar slodge avatar strazto avatar trestletech avatar wch avatar yihui avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.