Giter Club home page Giter Club logo

pushbar's Introduction

Travis build status

pushbar

Brings pushbar.js to Shiny; create off-canvas sliders for inputs, outputs or any other content.

Installation

Install with remotes

# install.packages("remotes")
remotes::install_github("JohnCoene/pushbar")

How to use

  1. Include pushbar_deps anywhere in your ui.
  2. Include setup_pushbar at the top of your server function, it'll also let you determine whether to use blur and overlay when pushbars are opened.
  3. Use pushbar in your ui to include content in pushbars.
  4. Use pushbar_open and pushbar_close to programatically (server-side) open and close the pushbars.

Also includes an event (see example) to capture whether a pushbar is opened (input$pushbarID_pushbar_opened).

Example

Live Demo

library(shiny)
library(pushbar)

ui <- fluidPage(
   pushbar_deps(),
	 br(),
   actionButton("open", "Open pushbar"),
   pushbar(
     h4("HELLO"),
     id = "myPushbar", # add id to get event
     actionButton("close", "Close pushbar")
   ),
   fluidRow(
     column(5),
     column(5, span("Is a pushbar opened?"), verbatimTextOutput("ev"))
   )
 )
 
 server <- function(input, output, session){

   setup_pushbar() # setup

   observeEvent(input$open, {
     pushbar_open(id = "myPushbar")
   })  

   observeEvent(input$close, {
     pushbar_close()
   })  

   output$ev <- renderPrint({
     input$myPushbar_pushbar_opened
   })
 }
 
 if(interactive()) shinyApp(ui, server)

pushbar's People

Contributors

johncoene avatar

Watchers

Gábor Csárdi avatar James Cloos avatar CRAN robot avatar  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.