Inputs

Inputs(self, values, ns=Root)

A class representing Shiny input values.

This class provides access to a Session's input values. The input values are reactive Values, and can be accessed with the [] operator, or with .. For example, if there is an input named x, it can be accessed via input["x"]() or input.x().

Methods

Name Description
set_serializer Add a function for serializing an input before bookmarking application state

set_serializer

Inputs.set_serializer(id, fn)

Add a function for serializing an input before bookmarking application state

Parameters

id : str

The ID of the input value.

fn : Callable[[Any, Path | None], Awaitable[Any | Unserializable]] | Callable[[Any, Path | None], Any | Unserializable]

A function that takes the input value and returns a modified value. The returned value will be used for test snapshots and bookmarking.