get_keys: Get the keys of a parameterised page

View source: R/keys.R

get_keysR Documentation

Get the keys of a parameterised page

Description

A page declared with a parameterised href (e.g. "/who/:id") exposes the values matched in the URL through get_keys(). Call it with no argument inside a page server, and pass it the request inside a page ui.

Usage

get_keys(x = shiny::getDefaultReactiveDomain())

Arguments

x

A shiny session, or the request object a page ui receives. Defaults to the session the code is running in.

Value

A named list of the values matched in the page href, or NULL outside of a brochure page.

Examples

library(shiny)
page(
  href = "/who/:id",
  ui = function(request) {
    h1(get_keys(request)$id)
  },
  server = function(input, output, session) {
    print(get_keys())
  }
)

brochure documentation built on Oct. 14, 2026, 5:08 p.m.