lt_spec: Extract a table's render-ready spec

View source: R/render.R

lt_specR Documentation

Extract a table's render-ready spec

Description

Return the JSON-ready spec for an lt() table: the raw data plus the declarative ops (and any lt_interactive() options), prepared exactly as the JavaScript runtime expects. This is the payload the runtime consumes, so another widget can embed an lt table by shipping this spec (e.g. xfun::tojson(lt_spec(x))) and rendering it client-side on demand with LT.render(container, spec) (or LT.buildHtml(spec)). Styling from lt_css() and CSS rules is dropped; attach the runtime assets separately (see lt_dependency()).

Usage

lt_spec(x)

Arguments

x

An lt_tbl object.

Value

A named list of spec fields (data, ops, and any others set on the table), ready to serialize to JSON.

Examples

spec = lt_spec(lt(head(mtcars)) |> lt_interactive())
str(spec, max.level = 1)
xfun::tojson(spec)  # ship this, then LT.render(container, spec) in the browser

lt documentation built on Oct. 17, 2026, 9:06 a.m.