This is my code:
card_function <- function(title,paragraph,tags){
div(
class = "card",
div(class = "header"),
div(
class = "info",
p(class = "title", 'title'),
p('paragraph')
),
div(
class = "footer",
p(class = "tag", 'tags'),
tags$button(id = "action", "Get started")
))
}
card_function(title = 'Titulo',paragraph = 'paragrafo',tags = 'HTML')
This is my error message:
Error in tags$button : $ operator is invalid for atomic vectors
I already tried to remove tags from tags$button but it didnt work.
Any help?
Either u can use tags$button syntax directly or simply use the div function to create a button-like element. I replaced button(id = "action", "Get started") with div(id = "action", "Get started", class = "button"). This should work regardless of whether you are using Shiny or not.
using library as directed by @SamR, you can avoid the conflict with the tags object from the shiny package, either by changing the argument name from tags to tag_names, or by using shiny::tags$button as directed by @r2evans, Here I changed tags to tag_names.