Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to use f7Segment() + f7Button() as a segmented control? #214

Open
rbcavanaugh opened this issue Jan 22, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@rbcavanaugh
Copy link

rbcavanaugh commented Jan 22, 2022

Hi thanks for putting together this package.

I was wondering if it was possible (or perhaps intended) to use the f7Segment() function as a segmented control (https://developer.apple.com/design/human-interface-guidelines/ios/controls/segmented-controls/). From one of the examples in the documentation:

f7Segment(
          container = "segment",
          f7Button(color = "blue", label = "My button", rounded = TRUE),
          f7Button(color = "green", label = "My button", rounded = TRUE),
          f7Button(color = "yellow", label = "My button", rounded = TRUE)
        )

This creates what appears to be a segmented control. However, selecting the button doesn't permanently change the color/fill of that button with respect to the others. The desired behavior would be something akin to shinyWidgets::radioGroupButtons().

thanks again!

Editing to add:
I was able to achieve this but rendering the f7Segment() on the server side within a renderUI() and changing the active = T/F argument for each button based on a reactiveValue that changed based on the most recent button press, but this feels a little clunky

@DivadNojnarg DivadNojnarg added the enhancement New feature or request label Nov 30, 2022
@DivadNojnarg
Copy link
Member

Hi, I can confirm, f7Segment is a just a simple container at the moment. I keep this in the backlog maybe for a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants