Hello world!
I'm programming my second R Shiny app, and my knowledge is growing.
But my skills on HTML, CSS and JS are still poor.
I am wondering how to add custom buttons in R shiny app.
Can we do this easily with a package or something to creat a new button?
Can you help me and show me how to implement one button please.
I have tried many things and I am lost.
Maybe someone could provide me minimal example for that..
For purpose of training, I'm trying to implement a small tool found on the internet (details below)
Let says I want to add 2 buttons:
Button1
Button2
I want to add it into R shiny: default view is the grey square, but highlighting in yellow when hover it (both images are in the attached png file).
Button1 will send the str("1") when clicked.
Button2 will send the str("2") when clicked.
If multiple click on the said button occurs, the value will grow like this:
One click on Button1-> c("1")
Two click on Button1-> c("1","1")
Two click on Button1 + One click on Button 2 -> c("1","1","2")
(eventually, I would like to know how to add "CLEAR" button to empty the string vector
The idea and source materials come from:
Original website: www(dot)ookii(dot)org/Software/Dni
Corresponding JS: www(dot)ookii(dot)org/Scripts/dni.js
EDIT1: I did manage to make the custom button, but it's not clickable and it doesnt highlight in yellow when hover:
css file : www(dot)ookii(dot)org/Content/software/dni.css
includeCSS("www/dni.css"),
tags$div(
id = "dni0",
class = "dniButton",
img(src = "images/dni/button0.png"),
alt="0",title="0",value="0"
)```