let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the top-level HTML element |
-| open | let
| Yes | boolean
| false
| Set to `true` to open the modal |
-| size | let
| No | "xs" | "sm" | "lg"
| undefined
| Set the size of the modal |
-| danger | let
| No | boolean
| false
| Set to `true` to use the danger variant |
-| alert | let
| No | boolean
| false
| Set to `true` to enable alert mode |
-| passiveModal | let
| No | boolean
| false
| Set to `true` to use the passive variant |
-| modalHeading | let
| No | string
| undefined
| Specify the modal heading |
-| modalLabel | let
| No | string
| undefined
| Specify the modal label |
-| modalAriaLabel | let
| No | string
| undefined
| Specify the ARIA label for the modal |
-| iconDescription | let
| No | string
| "Close the modal"
| Specify the ARIA label for the close icon |
-| hasForm | let
| No | boolean
| false
| Set to `true` if the modal contains form elements |
-| hasScrollingContent | let
| No | boolean
| false
| Set to `true` if the modal contains scrolling content |
-| primaryButtonText | let
| No | string
| ""
| Specify the primary button text |
-| primaryButtonDisabled | let
| No | boolean
| false
| Set to `true` to disable the primary button |
-| shouldSubmitOnEnter | let
| No | boolean
| true
| Set to `true` for the "submit" and "click:button--primary" eventslet
| No | string
| ""
| Specify the secondary button text |
-| secondaryButtons | let
| No | [{ text: string; }, { text: string; }]
| []
| 2-tuple prop to render two secondary buttons for a 3 button modallet
| No | string
| "[data-modal-primary-focus]"
| Specify a selector to be focused when opening the modal |
-| preventCloseOnClickOutside | let
| No | boolean
| false
| Set to `true` to prevent the modal from closing when clicking outside |
-| id | let
| No | string
| "ccs-" + Math.random().toString(36)
| Set an id for the top-level element |
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :------------------------- | :--------------- | :------- | :--------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
+| ref | let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the top-level HTML element |
+| open | let
| Yes | boolean
| false
| Set to `true` to open the modal |
+| size | let
| No | "xs" | "sm" | "lg"
| undefined
| Set the size of the modal |
+| danger | let
| No | boolean
| false
| Set to `true` to use the danger variant |
+| alert | let
| No | boolean
| false
| Set to `true` to enable alert mode |
+| passiveModal | let
| No | boolean
| false
| Set to `true` to use the passive variant |
+| modalHeading | let
| No | string
| undefined
| Specify the modal heading |
+| modalLabel | let
| No | string
| undefined
| Specify the modal label |
+| modalAriaLabel | let
| No | string
| undefined
| Specify the ARIA label for the modal |
+| iconDescription | let
| No | string
| "Close the modal"
| Specify the ARIA label for the close icon |
+| hasForm | let
| No | boolean
| false
| Set to `true` if the modal contains form elements |
+| hasScrollingContent | let
| No | boolean
| false
| Set to `true` if the modal contains scrolling content |
+| primaryButtonText | let
| No | string
| ""
| Specify the primary button text |
+| primaryButtonDisabled | let
| No | boolean
| false
| Set to `true` to disable the primary button |
+| primaryButtonIcon | let
| No | typeof import("svelte").SvelteComponent
| undefined
| Specify the primary button icon |
+| shouldSubmitOnEnter | let
| No | boolean
| true
| Set to `true` for the "submit" and "click:button--primary" eventslet
| No | string
| ""
| Specify the secondary button text |
+| secondaryButtons | let
| No | [{ text: string; }, { text: string; }]
| []
| 2-tuple prop to render two secondary buttons for a 3 button modallet
| No | string
| "[data-modal-primary-focus]"
| Specify a selector to be focused when opening the modal |
+| preventCloseOnClickOutside | let
| No | boolean
| false
| Set to `true` to prevent the modal from closing when clicking outside |
+| id | let
| No | string
| "ccs-" + Math.random().toString(36)
| Set an id for the top-level element |
### Slots
@@ -2351,15 +2352,16 @@ None.
### Props
-| Prop name | Kind | Reactive | Type | Default value | Description |
-| :-------------------- | :--------------- | :------- | :-------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------- |
-| primaryButtonText | let
| No | string
| ""
| Specify the primary button text |
-| primaryButtonDisabled | let
| No | boolean
| false
| Set to `true` to disable the primary button |
-| primaryClass | let
| No | string
| undefined
| Specify a class for the primary button |
-| secondaryButtonText | let
| No | string
| ""
| Specify the secondary button text |
-| secondaryButtons | let
| No | [{ text: string; }, { text: string; }]
| []
| 2-tuple prop to render two secondary buttons for a 3 button modallet
| No | string
| undefined
| Specify a class for the secondary button |
-| danger | let
| No | boolean
| false
| Set to `true` to use the danger variant |
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :-------------------- | :--------------- | :------- | :--------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------- |
+| primaryButtonText | let
| No | string
| ""
| Specify the primary button text |
+| primaryButtonIcon | let
| No | typeof import("svelte").SvelteComponent
| undefined
| Specify the primary button icon |
+| primaryButtonDisabled | let
| No | boolean
| false
| Set to `true` to disable the primary button |
+| primaryClass | let
| No | string
| undefined
| Specify a class for the primary button |
+| secondaryButtonText | let
| No | string
| ""
| Specify the secondary button text |
+| secondaryButtons | let
| No | [{ text: string; }, { text: string; }]
| []
| 2-tuple prop to render two secondary buttons for a 3 button modallet
| No | string
| undefined
| Specify a class for the secondary button |
+| danger | let
| No | boolean
| false
| Set to `true` to use the danger variant |
### Slots
diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json
index 78c211f6..2b5a1e00 100644
--- a/docs/src/COMPONENT_API.json
+++ b/docs/src/COMPONENT_API.json
@@ -6073,6 +6073,16 @@
"constant": false,
"reactive": false
},
+ {
+ "name": "primaryButtonIcon",
+ "kind": "let",
+ "description": "Specify the primary button icon",
+ "type": "typeof import(\"svelte\").SvelteComponent",
+ "isFunction": false,
+ "isFunctionDeclaration": false,
+ "constant": false,
+ "reactive": false
+ },
{
"name": "shouldSubmitOnEnter",
"kind": "let",
@@ -6237,6 +6247,16 @@
"constant": false,
"reactive": false
},
+ {
+ "name": "primaryButtonIcon",
+ "kind": "let",
+ "description": "Specify the primary button icon",
+ "type": "typeof import(\"svelte\").SvelteComponent",
+ "isFunction": false,
+ "isFunctionDeclaration": false,
+ "constant": false,
+ "reactive": false
+ },
{
"name": "primaryButtonDisabled",
"kind": "let",
diff --git a/docs/src/pages/components/Modal.svx b/docs/src/pages/components/Modal.svx
index ee93147c..1bd4a3bd 100644
--- a/docs/src/pages/components/Modal.svx
+++ b/docs/src/pages/components/Modal.svx
@@ -42,3 +42,6 @@ Use the `secondaryButtons` prop to render two secondary buttons for a "3-button
Do you really want to invite someone?
+