API reference

Jeamlit makes it easy for you to visualize, mutate, and share data. The API reference is organized by activity type, like displaying data or optimizing performance. Each section includes methods associated with the activity type, including examples.

Browse our API below and click to learn more about any of our available commands! šŸŽˆ


screenshot

Markdown

Display string formatted as Markdown.

Jt.markdown("Hello **world**!").use();
screenshot

Title

Display text in title formatting.

Jt.title("The app title").use();
screenshot

Code block

Display a code block with optional syntax highlighting.

Jt.code("a = 1234").use();
screenshot

Preformatted text

Write fixed-width and preformatted text.

Jt.text("Hello world").use();
screenshot

Divider

Display a horizontal rule.

Jt.divider().use();

Render HTML

Render an HTML string in your app.

Jt.html("<p>Foo bar.</p>").use();

screenshot

Static tables

Display a static table.

Jt.table(my_data).use();

screenshot

ECharts

Display a chart using the Apache ECharts library.

Jt.echarts(myChartConfig).use();

screenshot

Button

Display a button widget.

boolean clicked = Jt.button("Click me").use();
screenshot

Form button

Display a form submit button. For use with Jt.form.

boolean submitted = Jt.formSubmitButton("Sign up").use();
screenshot

Page link

Display a link to another page in a multipage app.

Jt.pageLink(HomePage.class).use(); Jt.pageLink("https://example.com", "Go to site").use();
screenshot

Checkbox

Display a checkbox widget.

boolean selected = Jt.checkbox("I agree").use();
screenshot

Radio

Display a radio button widget.

String choice = Jt.radio("Pick one", List.of("cats", "dogs")).use();
screenshot

Selectbox

Display a select widget.

choice = st.selectbox("Pick one", ["cats", "dogs"])
screenshot

Toggle

Display a toggle widget.

boolean activated = Jt.toggle("Activate").use();
screenshot

Number input

Display a numeric input widget.

Number choice = Jt.numberInput("Pick a number").use();
screenshot

Slider

Display a slider widget.

int number = Jt.slider("Pick a number").use();
screenshot

Date input

Display a date input widget.

LocalDate date = Jt.dateInput("Your birthday").use();
screenshot

Text-area

Display a multi-line text input widget.

String text = Jt.textArea("Text to translate").use();
screenshot

Text input

Display a single-line text input widget.

String name = Jt.textInput("First name").use();
screenshot

File uploader

Display a file uploader widget.

UploadedFile data = Jt.fileUploader("Upload a CSV").use();

screenshot

Columns

Insert containers laid out as side-by-side columns.

var cols = Jt.columns(2).use(); Jt.text("This is column 1").use(cols.col(0)); Jt.text("This is column 2").use(cols.col(1));
screenshot

Container

Insert a multi-element container.

var c = Jt.container().use(); Jt.text("This will show last").use(); Jt.text("This will show first").use(c); Jt.text("This will show second").use(c);
screenshot

Empty

Insert a single-element container.

var e = Jt.empty("my-empty").use(); Jt.text("This will show last").use(); Jt.text("This will be replaced").use(e); Jt.text("This will show first").use(e);
screenshot

Expander

Insert a multi-element container that can be expanded/collapsed.

var exp = Jt.expander("Open to see more").use(); Jt.text("This is more content").use(exp);
screenshot

Popover

Insert a multi-element popover container that can be opened/closed.

var pop = Jt.popover("Settings").use(); Jt.checkbox("Show completed").use(pop);
screenshot

Tabs

Insert containers separated into tabs.

var tabs = Jt.tabs(List.of("Tab 1", "Tab 2")).use(); Jt.text("This is tab 1").use(tabs.tab(0)); Jt.text("This is tab 2").use(tabs.tab(1));

screenshot

Error box

Display error message.

Jt.error("We encountered an error").use();

screenshot

Navigation

Configure the available pages in a multipage app.

Map<String, List<Object>> pages = Map.of( "Your account", List.of(logOut, settings), "Reports", List.of(overview, usage), "Tools", List.of(search) ); Jt.navigation(pages).use();
screenshot

Page

Define a page in a multipage app.

Object home = Jt.page( "home.java", "Home", ":material/home:" );
screenshot

Page link

Display a link to another page in a multipage app.

Jt.pageLink("App.java", "Home", "šŸ ").use(); Jt.pageLink("pages/Profile.java", "My profile").use();

Switch page

Programmatically navigates to a specified page.

Jt.switchPage("pages/MyPage.java");

Forms

Create a form that batches elements together with a "Submit" button.

var form = Jt.form().use(); String name = Jt.textInput("Name").use(form); String email = Jt.textInput("Email").use(form); boolean submitted = Jt.formSubmitButton("Sign up").use(form);

Rerun script

Rerun the script immediately.

Jt.rerun()

HTML

Render an HTML string in your app.

Jt.html("<p>Foo bar.</p>").use();

App Testing

Learn how to test your Jeamlit applications with unit tests, integration tests, and automated testing frameworks. Ensure your apps work correctly across different scenarios and user interactions.

@Test public void testButtonIsVisible() { PlaywrightUtils.runInSharedBrowser(testInfo, app, page -> { assertThat(page.locator("jt-button").first()).isVisible(WAIT_1_SEC_MAX); }); }
forum

Still have questions?

Go to our discussions forum for helpful information and advice from Jeamlit experts.