PhoenixPaper.TransferList (PhoenixPaper v0.1.0)

Copy Markdown View Source

A Material Design transfer list — two list boxes with buttons to move checked items between them.

Like PhoenixPaper.Autocomplete, this needs interactive state (which list each item currently lives in, which are checked), so it's a Phoenix.LiveComponent, not a stateless function component. It manages that state entirely on its own:

<.live_component
  module={PhoenixPaper.TransferList}
  id="permissions"
  items={["Read", "Write", "Admin"]}
/>

There is no on_change callback in this first version — the split lives only in the component's own state. A form that needs the current right list server-side isn't supported yet; ask if you need it and it'll be added (e.g. as a hidden input per item, or a message sent to the parent LiveView on every move).