Breaking Changes: Slot Renaming for Svelte 5 Compatibility
In Svelte 5, props and slots (#snippet) must have distinct names to avoid conflicts.
This release includes breaking changes to named slots across many components to ensure compatibility with Svelte 5. The changes follow a consistent pattern: slots that previously shared names with props have been renamed to use the Children suffix (e.g., labelText → labelChildren).
Renaming slots ensures that:
#snippetcan be used in Svelte 5 without prop/slot naming conflicts- Slot behavior still works in Svelte 3 and Svelte 4 with minimal breaking changes
Migration guide
Form Components: labelText → labelChildren
Svelte 3/4
<TextInput>
- <span slot="labelText">Custom Label</span>
+ <span slot="labelChildren">Custom Label</span>
</TextInput>
<ComboBox>
- <strong slot="labelText">Required: </strong>
+ <strong slot="labelChildren">Required: </strong>
</ComboBox>
<Checkbox>
- <span slot="labelText">I agree to the <a href="/terms">terms</a></span>
+ <span slot="labelChildren">I agree to the <a href="/terms">terms</a></span>
</Checkbox>
<Select>
- <span slot="labelText">Custom Label</span>
+ <span slot="labelChildren">Custom Label</span>
</Select>
<ProgressBar>
- <span slot="labelText">Custom Progress Label</span>
+ <span slot="labelChildren">Custom Progress Label</span>
</ProgressBar>Svelte 5
<TextInput>
{#snippet labelChildren()}
<span>Custom Label</span>
{/snippet}
</TextInput>
<ComboBox>
{#snippet labelChildren()}
<strong>Required: </strong>
{/snippet}
</ComboBox>
<Checkbox>
{#snippet labelChildren()}
<span>I agree to the <a href="/terms">terms</a></span>
{/snippet}
</Checkbox>
<Select>
{#snippet labelChildren()}
<span>Custom Label</span>
{/snippet}
</Select>
<ProgressBar>
{#snippet labelChildren()}
<span>Custom Progress Label</span>
{/snippet}
</ProgressBar>Notification Components: title/subtitle/caption → titleChildren/subtitleChildren/captionChildren
Svelte 3/4
<InlineNotification>
- <strong slot="title">Error: </strong>
- <span slot="subtitle">An internal server error occurred.</span>
+ <strong slot="titleChildren">Error: </strong>
+ <span slot="subtitleChildren">An internal server error occurred.</span>
</InlineNotification>
<ToastNotification>
- <strong slot="title">Error: </strong>
- <strong slot="subtitle">An internal server error occurred.</strong>
- <strong slot="caption">{new Date().toLocaleString()}</strong>
+ <strong slot="titleChildren">Error: </strong>
+ <strong slot="subtitleChildren">An internal server error occurred.</strong>
+ <strong slot="captionChildren">{new Date().toLocaleString()}</strong>
</ToastNotification>Svelte 5
<InlineNotification>
{#snippet titleChildren()}
<strong>Error: </strong>
{/snippet}
{#snippet subtitleChildren()}
<span>An internal server error occurred.</span>
{/snippet}
</InlineNotification>
<ToastNotification>
{#snippet titleChildren()}
<strong>Error: </strong>
{/snippet}
{#snippet subtitleChildren()}
<strong>An internal server error occurred.</strong>
{/snippet}
{#snippet captionChildren()}
<strong>{new Date().toLocaleString()}</strong>
{/snippet}
</ToastNotification>DataTable: title/description → titleChildren/descriptionChildren
Svelte 3/4
<DataTable headers={headers} rows={rows}>
- <h2 slot="title">Data Table Title</h2>
- <p slot="description">Table description text</p>
+ <h2 slot="titleChildren">Data Table Title</h2>
+ <p slot="descriptionChildren">Table description text</p>
</DataTable>Svelte 5
<DataTable headers={headers} rows={rows}>
{#snippet titleChildren()}
<h2>Data Table Title</h2>
{/snippet}
{#snippet descriptionChildren()}
<p>Table description text</p>
{/snippet}
</DataTable>Tile Group Components: legend prop → legendText, legendText slot → legendChildren
Svelte 3/4
-<TileGroup legend="Select a tile">
- <span slot="legendText">Custom Legend</span>
+<TileGroup legendText="Select a tile">
+ <span slot="legendChildren">Custom Legend</span>
</TileGroup>
-<SelectableTileGroup legend="Choose one">
+<SelectableTileGroup legendText="Choose one">
<!-- tiles -->
</SelectableTileGroup>
<RadioButtonGroup legendText="Select an option">
- <span slot="legendText">Custom Legend</span>
+ <span slot="legendChildren">Custom Legend</span>
</RadioButtonGroup>Svelte 5
<TileGroup legendText="Select a tile">
{#snippet legendChildren()}
<span>Custom Legend</span>
{/snippet}
</TileGroup>
<SelectableTileGroup legendText="Choose one">
<!-- tiles -->
</SelectableTileGroup>
<RadioButtonGroup legendText="Select an option">
{#snippet legendChildren()}
<span>Custom Legend</span>
{/snippet}
</RadioButtonGroup>Header Components: company prop → companyText, text slot → textChildren
Svelte 3/4
-<Header company="IBM">
+<Header companyText="IBM">
<!-- header content -->
</Header>
<HeaderAction>
- <span slot="text">Action</span>
+ <span slot="textChildren">Action</span>
</HeaderAction>Svelte 5
<Header companyText="IBM">
<!-- header content -->
</Header>
<HeaderAction>
{#snippet textChildren()}
<span>Action</span>
{/snippet}
</HeaderAction>⚠ BREAKING CHANGES
- radio-button-group: change
legendTextslot tolegendChildrenby @metonym (7f5fbe0, #2425), closes #2412 - tile-group: rename
legendtolegendTextby @metonym (2ffdeab, #2424) - selectable-tile-group: rename
legendtolegendTextby @metonym (d101a5e, #2424) - data-table: change
title/descriptionslots totitleChildren,descriptionChildrenby @metonym (855f283, #2423), closes #2413 - inline-notification: change
title/subtitle/captionslot names totitleChildren/subtitleChildren/captionChildrenby @metonym (3187319, #2419) - toast-notification: change
title/subtitle/captionslot names totitleChildren/subtitleChildren/captionChildrenby @metonym (4735d53, #2419), closes #2415 - header: change
companyprop tocompanyTextby @metonym (873967d, #2416) - header-action: change
textslot totextChildrenby @metonym (fac2a25, #2416) - context-menu-option: change
labelTextslot tolabelChildrenby @spburtsev (ed1336b, #2408) - file-uploader-drop-container: change
labelTextslot tolabelChildrenby @spburtsev (9edcceb, #2408) - file-uploader-button: change
labelTextslot tolabelChildrenby @spburtsev (c39957a, #2408) - number-input: change
labelTextslot tolabelChildrenby @spburtsev (9a4c5ee, #2408) - text-area: change
labelTextslot tolabelChildrenby @spburtsev (1c04b86, #2408) - text-input: change
labelTextslot tolabelChildrenby @spburtsev (39df16f, #2408) - password-input: change
labelTextslot tolabelChildrenby @spburtsev (a1600ae, #2408) - date-picker-input: change
labelTextslot tolabelChildrenby @spburtsev (eb0fd33, #2408) - toggle-skeleton: change
labelTextslot tolabelChildrenby @spburtsev (099cdd2, #2408) - toggle: change
labelTextslot tolabelChildrenby @spburtsev (b10f0c2, #2408) - search: change
labelTextslot tolabelChildrenby @spburtsev (b9fa85a, #2408) - multi-select: change
labelTextslot tolabelChildrenby @spburtsev (0f532d6, #2408) - select: change
labelTextslot tolabelChildrenby @spburtsev (9d33d08, #2408) - combo-box: change
labelTextslot tolabelChildrenby @spburtsev (9a43f35, #2408) - progress-bar: change
labelTextslot tolabelChildrenby @spburtsev (84cc94d, #2408) - slider: change
labelTextslot tolabelChildrenby @spburtsev (2b4f4c3, #2408) - checkbox: change
labelTextslot tolabelChildrenby @spburtsev (37849a3, #2408) - tree-view: change
labelTextslot tolabelChildrenby @spburtsev (74b7da5, #2408) - radio-button: change
labelTextslot tolabelChildrenby @spburtsev (81f02f5, #2408) - time-picker: change
labelTextslot tolabelChildrenby @spburtsev (7a17f70, #2408) - time-picker-select: change
labelTextslot tolabelChildrenby @spburtsev (a761811, #2408)
Features
- inline-notification: add
openprop by @metonym (63058c6, #2420), closes #630 - toast-notification: add
openprop by @metonym (d703135, #2421) - stack: support
gap={0}by @metonym (e374436, #2428), closes #2426 - selectable-tile-group: add
legendChildrenslot by @metonym (ddb6abd, #2425) - tile-group: add
legendChildrenslot by @metonym (4ff133b, #2425)
Bug Fixes
- pagination: update JSDoc descriptions for dispatched events by @metonym (4588944, #2429)
- time-picker: allow longer labels by @sachinbhutani (3d1d187, #2427), closes #1749
Full Changelog: v0.95.1...v0.96.0