-
|
Stack.Item appears in the Stack function documentation >
But doesn't appear to be implemented (I can find no reference to it in the package code). Is there some way to use it or is this not possible at the moment? I would like to be able to set individual stack item styles as in some of the examples on the Microsoft Fluent UI page |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Thanks for asking! Currently shiny.react cannot handle "nested" components, so shiny.fluent doesn't include them. I created issue #87 to track this feature. For now it is possible to use the following workaround: library(shiny.fluent)
CustomComponents <- tags$script(HTML("(function() {
const CustomComponents = jsmodule['CustomComponents'] = {};
const { Stack } = jsmodule['@fluentui/react'];
CustomComponents.StackItem = Stack.Item;
})();"))
Stack.Item <- function(...) shiny.react::reactElement(
module = "CustomComponents",
name = "StackItem",
props = shiny.react::asProps(...),
deps = shiny.fluent::shinyFluentDependency()
)
shinyApp(
ui = tagList(
CustomComponents,
Stack(
Stack.Item("One", order = 2),
Stack.Item("Two", order = 1)
)
),
server = function(input, output) {}
) |
Beta Was this translation helpful? Give feedback.
Thanks for asking! Currently shiny.react cannot handle "nested" components, so shiny.fluent doesn't include them. I created issue #87 to track this feature.
For now it is possible to use the following workaround: