let | No | HTMLElement | null | null | Reference element to position the portal relative to |
+| placement | No | let | No | "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "bottom" | Placement of the floating portal relative to the reference element |
+| offset | No | let | No | number | 0 | Offset in pixels from the reference element |
+| autoUpdate | No | let | No | boolean | true | Set to `true` to enable auto-update positioning on scroll/resize |
+
+### Slots
+
+| Slot name | Default | Props | Fallback |
+| :-------- | :------ | :---------------------------------- | :------- |
+| -- | Yes | Record | -- |
+
+### Events
+
+None.
+
## `FluidForm`
### Props
diff --git a/bun.lock b/bun.lock
index d260ce8ba3..badd9b5191 100644
--- a/bun.lock
+++ b/bun.lock
@@ -5,6 +5,7 @@
"": {
"name": "carbon-components-svelte",
"dependencies": {
+ "@floating-ui/dom": "^1.7.4",
"@ibm/telemetry-js": "^1.5.0",
"flatpickr": "4.6.9",
},
@@ -135,6 +136,12 @@
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.8", "", { "os": "win32", "cpu": "x64" }, "sha512-cn3Yr7+OaaZq1c+2pe+8yxC8E144SReCQjN6/2ynubzYjvyqZjTXfQJpAcQpsdJq3My7XADANiYGHoFC69pLQw=="],
+ "@floating-ui/core": ["@floating-ui/core@1.7.3", "", { "dependencies": { "@floating-ui/utils": "^0.2.10" } }, "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w=="],
+
+ "@floating-ui/dom": ["@floating-ui/dom@1.7.4", "", { "dependencies": { "@floating-ui/core": "^1.7.3", "@floating-ui/utils": "^0.2.10" } }, "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA=="],
+
+ "@floating-ui/utils": ["@floating-ui/utils@0.2.10", "", {}, "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ=="],
+
"@hutson/parse-repository-url": ["@hutson/parse-repository-url@3.0.2", "", {}, "sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q=="],
"@ibm/telemetry-js": ["@ibm/telemetry-js@1.10.2", "", { "bin": { "ibmtelemetry": "dist/collect.js" } }, "sha512-F8+/NNUwtm8BuFz18O9KPvIFTFDo8GUSoyhPxPjEpk7nEyEzWGfhIiEPhL00B2NdHRLDSljh3AiCfSnL/tutiQ=="],
diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json
index 75e806f54a..03b28c739d 100644
--- a/docs/src/COMPONENT_API.json
+++ b/docs/src/COMPONENT_API.json
@@ -1,5 +1,5 @@
{
- "total": 169,
+ "total": 170,
"components": [
{
"moduleName": "Accordion",
@@ -5663,6 +5663,72 @@
},
"contexts": []
},
+ {
+ "moduleName": "FloatingPortal",
+ "filePath": "src/Portal/FloatingPortal.svelte",
+ "props": [
+ {
+ "name": "reference",
+ "kind": "let",
+ "description": "Reference element to position the portal relative to",
+ "type": "HTMLElement | null",
+ "value": "null",
+ "isFunction": false,
+ "isFunctionDeclaration": false,
+ "isRequired": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "placement",
+ "kind": "let",
+ "description": "Placement of the floating portal relative to the reference element",
+ "type": "\"top\" | \"top-start\" | \"top-end\" | \"right\" | \"right-start\" | \"right-end\" | \"bottom\" | \"bottom-start\" | \"bottom-end\" | \"left\" | \"left-start\" | \"left-end\"",
+ "value": "\"bottom\"",
+ "isFunction": false,
+ "isFunctionDeclaration": false,
+ "isRequired": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "offset",
+ "kind": "let",
+ "description": "Offset in pixels from the reference element",
+ "type": "number",
+ "value": "0",
+ "isFunction": false,
+ "isFunctionDeclaration": false,
+ "isRequired": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "autoUpdate",
+ "kind": "let",
+ "description": "Set to `true` to enable auto-update positioning on scroll/resize",
+ "type": "boolean",
+ "value": "true",
+ "isFunction": false,
+ "isFunctionDeclaration": false,
+ "isRequired": false,
+ "constant": false,
+ "reactive": false
+ }
+ ],
+ "moduleExports": [],
+ "slots": [
+ {
+ "name": null,
+ "default": true,
+ "slot_props": "RecordFloating portal content
++ This content is positioned relative to the button above. +
+