Skip to content

Commit

Permalink
update readme + add first aliase
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Nov 16, 2023
1 parent 20b00b0 commit 9f41c85
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 8 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

export(accordion)
export(accordion_item)
export(actionButton)
export(action_button)
export(autocomplete)
export(autocomplete_item)
Expand Down Expand Up @@ -76,6 +77,7 @@ export(text_input)
export(textarea_input)
export(theme_switcher)
export(tooltip)
export(updateActionButton)
export(update_accordion)
export(update_action_button)
export(update_autocomplete)
Expand Down
46 changes: 46 additions & 0 deletions R/aliases.R
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
)
}
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ NextUI React [library](https://nextui.org/).

![](./man/figures/pkmn.png)

The app corresponding to the above screenshot is located [here](https://github.com/RinteRface/shinyNextUI/tree/main/inst/showcase).

## Notes

`{shinyNextUI}` is currently in alpha. Please carefully look at the current [issues](https://github.com/RinteRface/shinyNextUI/issues).

The current roadmap:

- Provide more aliases to match Shiny's vanilla notations like `selectInput`, ...
- Refine the navbar template.
- Allow to dynamically create [themes](https://nextui.org/docs/customization/theme).

`{shinyNextUI}` leverages tailwind css.

## Installation

You can install the development version of `{shinyNextUI}` from [GitHub](https://github.com/) with:
Expand All @@ -33,6 +47,8 @@ run_example("card")

## Developer

`{shinyNextUI}` leverages [tailwind](https://tailwindcss.com/) for the CSS management and [webpack](https://webpack.js.org/) as JS bundler.

Within the `js` folder, run `npm install`. Then, for each change:

```shell
Expand Down
103 changes: 95 additions & 8 deletions man/button.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f41c85

Please sign in to comment.