Shiny Dashboard collapsible box default state

2,532 views
Skip to first unread message

Jonathan Adler

unread,
Apr 16, 2015, 7:40:00 PM4/16/15
to shiny-...@googlegroups.com
Hi everyone,

I'm working on making a UI with Shiny Dashboards. I want to have part of the UI in a box that is collapsible (which I see how to do) but I can't seem to find a way to have the box default to collapsed. This is important since I want the box to have advanced controls that don't clutter the screen unless the user needs them.

Since the starting state of the collapsible box doesn't seem to be an obvious input to the box() function, I was hoping there would be some way to manually create the box element by cleverly using div() or tags() or something. Does anyone have any ideas?

Thanks,
Jonathan

mts...@gmail.com

unread,
Apr 18, 2015, 12:21:46 PM4/18/15
to shiny-...@googlegroups.com
I have this exact same question. Was searching to see if anyone posted.

I haven't found an answer or way to do this. But I'm trying to do something similar, I want the advanced options to be available when they click the box, otherwise they just get in the way.

Thanks,
Mike

Winston Chang

unread,
Apr 20, 2015, 9:50:54 PM4/20/15
to mts...@gmail.com, shiny-discuss
Hi, that isn't possible now, but hopefully we'll be able to add it in the not-too-distant future.
Someone else has filed the issue:

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/d75437b3-d64e-4913-ae6f-1f06453123a3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Winston Chang

unread,
Apr 20, 2015, 10:42:05 PM4/20/15
to mts...@gmail.com, shiny-discuss
I've added a new option, `collapsed`, which lets the box start collapsed.

Jonathan Adler

unread,
Apr 20, 2015, 11:58:56 PM4/20/15
to shiny-...@googlegroups.com, mts...@gmail.com
Thanks Winston!

mts...@gmail.com

unread,
Apr 29, 2015, 10:20:47 AM4/29/15
to shiny-...@googlegroups.com, mts...@gmail.com
I agree, Thanks Winston.

Hey, trying to use this. I reran install.packages('shinydshboard') and tried to specify the following ways but couldn't get the box to default to collapsed.

box(
          title = "Box of my Tables", width=12, status = "primary", solidHeader = TRUE,
          collapsible = TRUE, collapsed=TRUE,

box(
          title = "Box of my Tables", width=12, status = "primary", solidHeader = TRUE,
          collapsed=TRUE,

Thanks,
Mike

mts...@gmail.com

unread,
Jun 17, 2015, 12:25:45 PM6/17/15
to shiny-...@googlegroups.com
Hey - I got this to work. I'm thinking I just needed to update the package.

fluidRow(column(12,
      box(
          title = "EDIT -  Your Worksheets", width=12, status = "primary", solidHeader = TRUE,
          collapsible = TRUE,collapsed=TRUE,

I'm thinking about it, but would there be a way to only uncollapse the box based on a conditional statement.

Like I want to lock it out and keep it closed in certain circumstances.

Thanks
Mike
Reply all
Reply to author
Forward
0 new messages