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! š
Display almost anything
Text elements

Markdown
Display string formatted as Markdown.
Jt.markdown("Hello **world**!").use();

Title
Display text in title formatting.
Jt.title("The app title").use();

Code block
Display a code block with optional syntax highlighting.
Jt.code("a = 1234").use();

Preformatted text
Write fixed-width and preformatted text.
Jt.text("Hello world").use();

Divider
Display a horizontal rule.
Jt.divider().use();
Render HTML
Render an HTML string in your app.
Jt.html("<p>Foo bar.</p>").use();
Data elements

Static tables
Display a static table.
Jt.table(my_data).use();
Chart elements

ECharts
Display a chart using the Apache ECharts library.
Jt.echarts(myChartConfig).use();
Input widgets
Button
Display a button widget.
boolean clicked = Jt.button("Click me").use();
Form button
Display a form submit button. For use with Jt.form
.
boolean submitted = Jt.formSubmitButton("Sign up").use();

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();

Checkbox
Display a checkbox widget.
boolean selected = Jt.checkbox("I agree").use();

Radio
Display a radio button widget.
String choice = Jt.radio("Pick one", List.of("cats", "dogs")).use();

Selectbox
Display a select widget.
choice = st.selectbox("Pick one", ["cats", "dogs"])

Toggle
Display a toggle widget.
boolean activated = Jt.toggle("Activate").use();

Number input
Display a numeric input widget.
Number choice = Jt.numberInput("Pick a number").use();

Slider
Display a slider widget.
int number = Jt.slider("Pick a number").use();

Date input
Display a date input widget.
LocalDate date = Jt.dateInput("Your birthday").use();

Text-area
Display a multi-line text input widget.
String text = Jt.textArea("Text to translate").use();

Text input
Display a single-line text input widget.
String name = Jt.textInput("First name").use();

File uploader
Display a file uploader widget.
UploadedFile data = Jt.fileUploader("Upload a CSV").use();
Layouts and containers

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));

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);

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);

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);
Popover
Insert a multi-element popover container that can be opened/closed.
var pop = Jt.popover("Settings").use();
Jt.checkbox("Show completed").use(pop);

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));
Status elements

Error box
Display error message.
Jt.error("We encountered an error").use();
App logic and configuration
Navigation and pages

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();

Page
Define a page in a multipage app.
Object home = Jt.page(
"home.java",
"Home",
":material/home:"
);

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");
Execution flow
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()
Custom Components
HTML
Render an HTML string in your app.
Jt.html("<p>Foo bar.</p>").use();
Developer tools
App testing
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);
});
}
Still have questions?
Go to our discussions forum for helpful information and advice from Jeamlit experts.