Corex. Point
(Corex v0.1.2)
View Source
Two-dimensional point (x, y) for Zag.js layout.
Used when a component needs a fixed pixel position instead of anchor-based
placement—for example Corex.FloatingPanel position
(defaultPosition / data-default-position).
Pass either %Corex.Point{x: 0, y: 0} or a map %{x: 0, y: 0}.
Example
<.floating_panel
id="my-floating-panel"
class="floating-panel"
position={%Corex.Point{x: 120, y: 80}}
>
<:trigger class="button button--ghost button--sm">
<span data-closed>Open panel</span>
<span data-open>Close panel</span>
</:trigger>
<:title>Panel</:title>
<:minimize_trigger>
<.heroicon name="hero-arrow-down-left" class="icon" />
</:minimize_trigger>
<:maximize_trigger>
<.heroicon name="hero-arrows-pointing-out" class="icon" />
</:maximize_trigger>
<:default_trigger>
<.heroicon name="hero-rectangle-stack" class="icon" />
</:default_trigger>
<:close_trigger>
<.heroicon name="hero-x-mark" class="icon" />
</:close_trigger>
<:content>
<p>
Congue molestie ipsum gravida a. Sed ac eros luctus, cursus turpis
non, pellentesque elit. Pellentesque sagittis fermentum.
</p>
</:content>
</.floating_panel>
Summary
Functions
Normalizes a point struct or map for JSON / data attributes.