Tooltips inside modals
Components with tooltips (CodeSnippet, CopyButton, Tooltip, TooltipDefinition, TooltipIcon, PasswordInput) now automatically portal the tooltip when used inside modals to avoid clipping.
Set portalTooltip to true to opt-in, and portalTooltip to false to opt-out if used inside modals.
TooltipIcon and TooltipDefinition behavior
Similar to Tooltip, both TooltipIcon and TooltipDefinition implement a hover-trigger delay to avoid accidental triggers.
The default enterDelayMs is 100 and leaveDelayMs is 300.
<script>
import { TooltipIcon } from "carbon-components-svelte";
import Carbon from "carbon-icons-svelte/lib/Carbon.svelte";
</script>
<TooltipIcon
tooltipText="Slow to appear"
icon={Carbon}
enterDelayMs={500}
leaveDelayMs={500}
/>FileUploader upgrades
FileUploader implements many quality-of-life improvements:
orderFiles: control orderingpreventDuplicates: automatically filter out duplicate files- Stable file IDs: improve file IDs for performance and correctness
- Dispatch
clear/changewhen clearing - Dispatch
rejectedwhen a file exceedsmaxFileSize iconDescription: better defaults and file metadata passed through for per-file labels.
See the FileUploader docs.
<FileUploader
multiple
orderFiles={(existing, added) => {
return [...existing, ...added].sort(
(a, b) => b.lastModified - a.lastModified,
);
}}
labelTitle="Upload files"
buttonLabel="Add files"
labelDescription="Files are sorted by last modified (newest first)."
status="edit"
on:clear
on:change
on:rejected
/>
SelectableTag
New SelectableTag for selectable tag patterns (closes #2763).
See the SelectableTag docs.
<script>
import { SelectableTag } from "carbon-components-svelte";
let selected = false;
</script>
<SelectableTag bind:selected on:change>
{selected ? "Selected" : "Unselected"}
</SelectableTag>
FloatingPortal layout
Lower-level positioning improvements: intrinsicWidth, intrinsicAlign, left/right placement, and gap props for fine-tuned floating UI.
See the FloatingPortal docs.
Theming and loading states
Theme: setscolor-schemeon the root element so native controls follow light/dark appropriately.SkeletonPlaceholder: newsize/width/heightpropsSkeletonIcon: new component
<script>
import { SkeletonIcon, SkeletonPlaceholder } from "carbon-components-svelte";
</script>
<SkeletonIcon />
<SkeletonPlaceholder size="8rem" />MultiSelect: isSelectAll item option
Any item in items can set isSelectAll: true so it behaves as a select all / clear all row: it toggles every other enabled option, shows checked or indeterminate state from the rest of the list, and is excluded from normal selection payloads.
Use it for a first-row "All …" pattern in filterable or standard multi-selects.
See the MultiSelect docs.
<script>
import { MultiSelect } from "carbon-components-svelte";
</script>
<MultiSelect
filterable
labelText="Roles"
placeholder="Filter roles..."
items={[
{ id: "select-all", text: "All roles", isSelectAll: true },
{ id: "editor", text: "Editor" },
{ id: "owner", text: "Owner" },
{ id: "uploader", text: "Uploader" },
{ id: "reader", text: "Reader", disabled: true },
]}
/>ComboBox: selectTextOnFocus
Set selectTextOnFocus to true so the entire input value is selected when the field gains focus (tab or click). Users can replace the current selection by typing immediately, without first dragging to select. This complements patterns like clearing the filter on open when you want a different behavior.
See the ComboBox docs.
<script>
import { ComboBox } from "carbon-components-svelte";
</script>
<ComboBox
selectTextOnFocus
labelText="Contact"
placeholder="Select contact method"
selectedId="1"
value="Email"
items={[
{ id: "0", text: "Slack" },
{ id: "1", text: "Email" },
{ id: "2", text: "Fax" },
]}
/>
Forms and menus
ContentSwitcher:selectionModefor manual vs automatic selection. #2766ContextMenu: callinge.preventDefault()on an item keeps the menu open; auto-indent fix when an option has an icon. #2768 · #2771
What's changed
- feat(combo-box): add
selectTextOnFocusprop by @metonym in #2755 - feat(content-switcher): add
selectionModeprop by @metonym in #2766 - feat(context-menu):
e.preventDefault()prevents menu from closing by @metonym in #2768 - feat(file-uploader): add
orderFilesprop by @metonym in #2776 - feat(file-uploader): improvements by @metonym in #2774
- feat(multi-select): support
isSelectAllitem option by @metonym in #2756 - feat(skeleton-icon): add
SkeletonIconcomponent by @metonym in #2779 - feat(skeleton-placeholder): add size/width/height props by @metonym in #2778
- feat(tag): add
SelectableTagby @metonym in #2769 - feat(theme): set
color-schemeon root element by @metonym in #2786 - feat(tooltip): add enter/leave delay for
TooltipIconandTooltipDefinitionby @metonym in #2783 - feat(tooltip): portal
TooltipDefinitionandTooltipIconinside modals by @metonym in #2780 - feat(tooltip): portal tooltip inside modal context by @metonym in #2753
- feat(tooltip-definition): add
clickToOpenprop by @metonym in #2767 - feat(tooltip-icon): add
openprop and open/close events by @metonym in #2782 - feat: portal
CodeSnippetandCopyButtontooltip inside modal context by @metonym in #2752 - fix(context-menu): auto-indent option with icon by @metonym in #2771
- fix(data-table): custom sort accounts for sort direction by @GaboUCR in #2797
- fix(inline-notification): title uses
strongelement for emphasis by @b-r-i-a-n-w-e-s-t in #2750 - fix(password-input): portal tooltip inside modal context by @metonym in #2751
- fix(side-nav-menu):
buttonshould not nestdivelements by @b-r-i-a-n-w-e-s-t in #2796 - fix(toolbar-search): remove redundant
<any>from Row generics by @metonym in #2798 - fix(tooltip-icon): only one tooltip is visible at a time by @metonym in #2777
- fix(ui-shell): header action button style fixes by @metonym in #2787
New contributors
Full changelog: v0.103.0...v0.104.0