# Text elements

Source: https://docs.streamlit.io/develop/api-reference/text

Streamlit apps usually start with a call to `st.title` to set the
app's title. After that, there are 2 heading levels you can use:
`st.header` and `st.subheader`.

Pure text is entered with `st.text`, and Markdown with
`st.markdown`.

We also offer a "swiss-army knife" command called `st.write`, which accepts
multiple arguments, and multiple data types. And as described above, you can
also use [magic commands](https://docs.streamlit.io/develop/api-reference/write-magic/magic) in place of `st.write`.

## Headings and body text

**[Markdown](https://docs.streamlit.io/develop/api-reference/text/st.markdown)**: Display string formatted as Markdown.

```python
st.markdown("Hello **world**!")
```

**[Title](https://docs.streamlit.io/develop/api-reference/text/st.title)**: Display text in title formatting.

```python
st.title("The app title")
```

**[Header](https://docs.streamlit.io/develop/api-reference/text/st.header)**: Display text in header formatting.

```python
st.header("This is a header")
```

**[Subheader](https://docs.streamlit.io/develop/api-reference/text/st.subheader)**: Display text in subheader formatting.

```python
st.subheader("This is a subheader")
```

## Formatted text

**[Badge](https://docs.streamlit.io/develop/api-reference/text/st.badge)**: Display a small, colored badge.

```python
st.badge("New")
```

**[Caption](https://docs.streamlit.io/develop/api-reference/text/st.caption)**: Display text in small font.

```python
st.caption("This is written small caption text")
```

**[Code block](https://docs.streamlit.io/develop/api-reference/text/st.code)**: Display a code block with optional syntax highlighting.

```python
st.code("a = 1234")
```

**[Echo](https://docs.streamlit.io/develop/api-reference/text/st.echo)**: Display some code on the app, then execute it. Useful for tutorials.

```python
with st.echo():
  st.write('This code will be printed')
```

**[Preformatted text](https://docs.streamlit.io/develop/api-reference/text/st.text)**: Write fixed-width and preformatted text.

```python
st.text("Hello world")
```

**[LaTeX](https://docs.streamlit.io/develop/api-reference/text/st.latex)**: Display mathematical expressions formatted as LaTeX.

```python
st.latex(r"\int a x^2 \,dx")
```

**[Divider](https://docs.streamlit.io/develop/api-reference/text/st.divider)**: Display a horizontal rule.

```python
st.divider()
```

## Utilities

**[Get help](https://docs.streamlit.io/develop/api-reference/text/st.help)**: Display object’s doc string, nicely formatted.

```python
st.help(st.write)
st.help(pd.DataFrame)
```

**[Render HTML](https://docs.streamlit.io/develop/api-reference/text/st.html)**: Renders HTML strings to your app.

```python
st.html("<p>Foo bar.</p>")
```

**[Iframe](https://docs.streamlit.io/develop/api-reference/text/st.iframe)**: Display content in an iframe

```python
from pathlib import Path
st.iframe("https://docs.streamlit.io")
st.iframe("<p>Streamlit is cool.</p>")
st.iframe(Path("my_content.html"))
```
