Comments (2)
As a backup:
#' Multi views layout
#'
#' @param ... Slot for \link{f7View}.
#' @export
f7ViewLayout <- function(...) {
items <- list(...)
tabbarItems <- lapply(seq_along(items), function(i) {
temp <- items[[i]][[1]]
icon <- items[[i]][[2]]
isActive <- length(grep(x = temp$attribs$class, pattern = "tab-active")) == 1
shiny::a(
href = paste0("#", temp$attribs$`data-name`),
class = if (isActive) "tab-link tab-link-active" else "tab-link",
icon
)
})
viewTabbar <- shiny::tags$div(
class = "toolbar tabbar toolbar-bottom",
shiny::tags$div(
class = "toolbar-inner",
tabbarItems
)
)
shiny::tagList(
f7InputsDeps(),
shiny::tags$div(
class = "views tabs",
# the menu must come first!
lapply(seq_along(items), function(i) items[[i]][[1]])
)
)
}
#' Create an f7View
#'
#' A child of \link{f7ViewLayout}
#'
#' @param ... View content.
#' @param id View unique id
#' @param name View name: ie "view-main". If you specify "view-main", it will be
#' the main view.
#' @param main Whether it is the main view.
#' @param active Whether to start on that view. Only 1 view may be active at a time.
#' @param icon Icon.
#' @export
f7View <- function(..., id, name, main = FALSE, active = FALSE, icon = NULL) {
viewCl <- paste("view tab")
if (main) viewCl <- paste(viewCl, "view-main")
if (active) viewCl <- paste(viewCl, "tab-active")
list(
shiny::tags$div(
id = id,
`data-name` = name,
class = viewCl,
...
),
icon
)
}
from shinymobile.
See opened POC and {brochure}
from shinymobile.
Related Issues (20)
- f7Page Issue HOT 2
- with shiny1.7.2, renderUI and shinyJS::show are not working HOT 3
- f7 functions not working anymore HOT 6
- uiOutput does not work in the f7Panel
- Adding a language parameter in f7SmartSelector HOT 1
- Modify f7Col width as it is possible with Rshiny::column(width=10)
- Popups can't be reopened multiple times HOT 2
- updateF7Select choices HOT 1
- js code not working HOT 8
- some error when use app_container function HOT 1
- Stylesheet not load... sometimes. Works on refresh page... sometimes. HOT 1
- General error on `f7Popup()` function HOT 1
- f7TabLayout problem HOT 5
- about Authentication HOT 2
- Tab labels not showing HOT 2
- How to run shinymobile in desktop as mobile app HOT 1
- Is it possible to use validateF7Input() on an input rendered on the server using renderUI() ? HOT 2
- Is this project still alive? HOT 2
- f7DatePicker is off by one day
- height parameter doesn't work on r7ExpandableCard HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shinymobile.