OctantisWeb.Components.PolarisWC.SModal (octantis v0.2.0)
View SourceDisplays content in an overlay. Use to create a distraction-free experience such as a confirmation dialog or a settings panel.
Example
<.s_button command_for="modal">
Open
</.s_button>
<.s_modal id="modal" heading="Details">
<.s_paragraph>
Displaying more details here.
</.s_paragraph>
<:secondary_action command_for="modal" command="--hide">Close</.secondary_action>
<:primary_action command_for="modal" command="--hide">Save</:primary_action>
</.s_modal>See
Summary
Functions
Displays content in an overlay. Use to create a distraction-free experience such as a confirmation dialog or a settings panel.
Functions
Displays content in an overlay. Use to create a distraction-free experience such as a confirmation dialog or a settings panel.
Example
<.s_button command_for="modal">
Open
</.s_button>
<.s_modal id="modal" heading="Details">
<.s_paragraph>
Displaying more details here.
</.s_paragraph>
<:secondary_action command_for="modal" command="--hide">Close</.secondary_action>
<:primary_action command_for="modal" command="--hide">Save</:primary_action>
</.s_modal>See
Attributes
accessibility_label(:string) - A label that describes the purpose of the modal. When set, it will be announced to users using assistive technologies and will provide them with more context.This overrides the
headingprop for screen readers.heading(:string) - A title that describes the content of the Modal.hide_overlay(:string) - () => voidMethod to hide an overlay.
padding(:string) - "base" | "none"Adjust the padding around the Modal content.
base: applies padding that is appropriate for the element.none: removes all padding from the element. This can be useful when elements inside the Modal need to span to the edge of the Modal. For example, a full-width image. In this case, rely onBoxwith a padding of 'base' to bring back the desired padding for the rest of the content.show_overlay(:string) - () => voidMethod to show an overlay.
size(:string) - "small" | "small-100" | "base" | "large" | "large-100"Adjust the size of the Modal.
toggle_overlay(:string) - () => voidMethod to toggle the visiblity of an overlay.
afterhide(:string)aftershow(:string)hide(:string)show(:string)Global attributes are accepted.
Slots
primary_action- The primary action to perform.Only a `Button` with a variant of `primary` is allowed.secondary_action- The secondary actions to perform.Only
ButtonGrouporButtonwith a variant ofsecondaryorautoare allowed.inner_block