Welcome to {litter}

Repository

As much as we love the shiny web framework, one great limitation is how inputs are handled. Inputs are set given an inputId which directly translates to an id in the generated HTML.

This means every input must be unique which makes it's difficult to dynamically generate inputs. Whilst manageable UI-side with a simple loop it makes a mess server-side as one has to dynamically create and destroy observers.

This project takes inspiration from vanilla JavaScript where one can "observe" on any valid selector such as a .class (as opposed to shiny which can only observe on #id), this means one can have a single observe for multiple inputs.

This project implements something similar for shiny by allowing users to create inputs that, instead of inputId, take a name argument which can be shared by multiple inputs. This makes it possible to sensibly dynamically generate inputs in R as each input does not need its corresponding observer.

You can see a small explanation/example with litter::gallery().

Powered by Doctave