diff --git a/mesop/components/expansion_panel/e2e/expansion_panel_app.py b/mesop/components/expansion_panel/e2e/expansion_panel_app.py
index 0e99b257..56b3af68 100644
--- a/mesop/components/expansion_panel/e2e/expansion_panel_app.py
+++ b/mesop/components/expansion_panel/e2e/expansion_panel_app.py
@@ -38,8 +38,7 @@ def app():
me.text("Pineapple content.")
with me.expansion_panel(
- title="Cantalope title",
- description="Type of fruit",
+ title="Cantalope (no description)",
hide_toggle=True,
):
me.text("Cantalope content.")
diff --git a/mesop/components/expansion_panel/e2e/expansion_panel_test.ts b/mesop/components/expansion_panel/e2e/expansion_panel_test.ts
index 458892d4..92ceb1dd 100644
--- a/mesop/components/expansion_panel/e2e/expansion_panel_test.ts
+++ b/mesop/components/expansion_panel/e2e/expansion_panel_test.ts
@@ -23,7 +23,7 @@ test.describe('Expansion Panel', () => {
await page
.locator('[aria-disabled="false"] span.mat-content-hide-toggle')
.textContent(),
- ).toContain('Cantalope title');
+ ).toContain('Cantalope (no description)');
});
});
diff --git a/mesop/components/expansion_panel/expansion_panel.ng.html b/mesop/components/expansion_panel/expansion_panel.ng.html
index ace96041..b6254b6c 100644
--- a/mesop/components/expansion_panel/expansion_panel.ng.html
+++ b/mesop/components/expansion_panel/expansion_panel.ng.html
@@ -8,11 +8,13 @@
>
{{config().getTitle()}}
+ @if (config().getDescription()) {
{{config().getDescription()}} @if (config().getIcon()) {
{{config().getIcon()}}
}
+ }