Fluxon (Fluxon v2.0.0)
To use Fluxon components in your LiveView or View modules, add the following to your module:
use Fluxon
This will import all available components. You can customize which components to import using the following options:
:only
- List of components to import. Only the specified components will be imported.use Fluxon, only: [:button, :input, :modal]
:except
- List of components to exclude. All components except the specified ones will be imported.use Fluxon, except: [:table, :tabs]
Summary
Functions
Closes a dialog component (modal, sheet).
Closes a dialog via push event.
Closes a popover component.
Opens a dialog component (modal, sheet).
Opens a dialog via push event.
Opens a popover component.
Functions
Closes a dialog component (modal, sheet).
Parameters
id
- The ID of the dialog element to close.
Example
<.button phx-click={Fluxon.close_dialog("my-modal")}>Close modal</.button>
<.modal id="my-modal"></.modal>
Closes a dialog via push event.
Parameters
socket
- ThePhoenix.LiveView.Socket
struct.id
- The ID of the dialog element to close.
Example
def handle_event("close_dialog", _, socket) do
{:noreply, Fluxon.close_dialog(socket, "my-dialog")}
end
Closes a popover component.
Parameters
id
- The ID of the popover element to close.
Example
<.button phx-click={Fluxon.close_popover("my-popover")}>Close popover</.button>
<.popover id="my-popover"></.popover>
Opens a dialog component (modal, sheet).
Example
<.button phx-click={Fluxon.open_dialog("my-modal")}>Open modal</.button>
<.modal id="my-modal"></.modal>
Opens a dialog via push event.
Parameters
socket
- ThePhoenix.LiveView.Socket
struct.id
- The ID of the dialog element to open.
Example
def handle_event("open_dialog", _, socket) do
{:noreply, Fluxon.open_dialog(socket, "my-dialog")}
end
Opens a popover component.
Example
<.button phx-click={Fluxon.open_popover("my-popover")}>Open popover</.button>
<.popover id="my-popover"></.popover>