-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20b00b0
commit 9f41c85
Showing
4 changed files
with
159 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#' Action button | ||
#' | ||
#' This is a higher level wrapper of \link{action_button} to match | ||
#' vanilla's Shiny syntax and parameters. | ||
#' | ||
#' @inheritParams shiny::actionButton | ||
#' @param width Not used with NextUI but left for compatibility. | ||
#' @export | ||
#' | ||
#' @example inst/examples/button/app.R | ||
#' @seealso See \url{https://nextui.org/docs/components/button} | ||
#' and \link{action_button} to get the list of possible parameters. | ||
#' @rdname button | ||
actionButton <- function(inputId, label, icon = NULL, width = NULL, ...) { | ||
action_button( | ||
inputId, | ||
..., | ||
children = label, | ||
startContent = icon, | ||
width = width | ||
) | ||
} | ||
|
||
#' Update an action button | ||
#' | ||
#' This is a higher level wrapper of \link{update_action_button} to match | ||
#' vanilla's Shiny syntax and parameters. | ||
#' | ||
#' @inheritParams shiny::updateActionButton | ||
#' @export | ||
#' | ||
#' @example inst/examples/button/app.R | ||
#' @rdname button | ||
updateActionButton <- function( | ||
session = getDefaultReactiveDomain(), | ||
inputId, | ||
label = NULL, | ||
icon = NULL | ||
) { | ||
update_action_button( | ||
session, | ||
inputId, | ||
children = label, | ||
startContent = icon | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.