GitPedia
woylie

woylie/flop_phoenix

Components for pagination, sortable tables and filter forms using Phoenix, Ecto and Flop

30 Releases
Latest: 3mo ago
0.26.0Latest
woyliewoylieยท3mo agoยทMarch 13, 2026
GitHub

๐Ÿ“‹ Changed

  • Breaking: Wrap the sorting indicator in the table header inside the sort
  • link. Remove wrapper `span` and the `th_wrapper_attrs` option. Please check
  • your table styles when upgrading (see HTML differences below).
  • Add `head` slot to `Flop.Phoenix.table/1`.

๐Ÿ› Fixed

  • Remove unused require Logger warnings in Elixir 1.20.

๐Ÿ“‹ Changed table header markup

  • Sortable table header markup before the change:
  • ```html
  • <th aria-sort="ascending">
  • <span>
  • <a href="/">Name</a>
  • <span class="order-direction">โ–ด</span>
  • </span>
  • </th>
  • + 10 more
0.25.3
woyliewoylieยท10mo agoยทJuly 31, 2025
GitHub

๐Ÿ“‹ Changed

  • Require `phoenix_live_view` `~> 1.0.6 or ~> 1.1.0`.
0.25.2
woyliewoylieยท1y agoยทJune 25, 2025
GitHub

๐Ÿ› Fixed

  • Allow overriding `maxlength` attribute in filter value field.
0.25.1
woyliewoylieยท1y agoยทMay 5, 2025
GitHub

๐Ÿ› Fixed

  • Function clause error when no pagination parameters are passed and no
  • `default_pagination_type` is set.
0.25.0
woyliewoylieยท1y agoยทMay 4, 2025
GitHub

โœจ Added

  • Add guide about load-more buttons and infinite scroll.
  • Add guide about CSS styles.
  • Add guide about page size controls.

๐Ÿ“‹ Changed

  • Remove `opts` attribute from `Flop.Phoenix.pagination/1` and remove
  • configuration of the pagination component via application environment.
  • Remove all default classes from pagination component.
  • Remove `wrapper_attrs` from pagination component in favor of global
  • attributes.
  • Set page link aria label function with `page_link_aria_label_fun` attribute
  • on `Flop.Phoenix.pagination/1` component instead of using
  • `pagination_link_aria_label` option.
  • + 24 more

๐Ÿ“ฆ How to upgrade

  • The configuration via `pagination_opts` is deprecated. Instead of referencing a
  • function that returns the pagination opts, it is recommended to define a
  • component that wraps the `Flop.Phoenix.pagination/1` component and sets the
  • necessary attributes.
  • Follow the upgrade guide of version 0.24.0 to update the pagination component
  • configuration, including the removal of the application configuration, if you
  • haven't done so already.
  • Remove the `wrapper_opts` from your pagination options and pass them directly
  • + 111 more
0.24.1
woyliewoylieยท1y agoยทFebruary 3, 2025
GitHub

๐Ÿ› Fixed

  • Determine pagination type when there is only a `limit`.
0.24.0
woyliewoylieยท1y agoยทFebruary 1, 2025
GitHub

โœจ Added

  • Add `Flop.Phoenix.Pagination` struct to hold information needed to render
  • a pagination component.
  • Add `Flop.Phoenix.Pagination.new/2` to build a `Pagination` struct from a
  • `Flop.Meta` struct.
  • Add `Flop.Phoenix.pagination_for/1` for building custom pagination components.
  • Update the existing `Flop.Phoenix.pagination/1` component to it.
  • Add `Flop.Phoenix.page_link_range/3` for determining which page links to
  • render in a pagination component.

๐Ÿ“‹ Changed

  • Support cursor pagination in `Flop.Phoenix.pagination/1`.
  • Remove the `page_links` option from the `pagination_opts`. Set this option
  • with the new `page_links` attribute instead.
  • Change the values of the `page_links` option from
  • `:all | :hide | {:ellipsis, pos_integer}` to `:all | :none | pos_integer`.
  • Change default value for `page_links` option of the
  • `Flop.Phoenix.pagination/1` component from `:all` to `5`.
  • Deprecate configuring the `pagination` and `table` components via the
  • + 5 more

๐Ÿ—‘๏ธ Removed

  • Remove `Flop.Phoenix.cursor_pagination/1`. Use `Flop.Phoenix.pagination/1`
  • instead.
  • Remove `t:Flop.Phoenix.cursor_pagination_option/0`.
  • Remove `Flop.Phoenix.IncorrectPaginationTypeError`.
  • Remove `input_type/3` from the `Phoenix.HTML.FormData` protocol
  • implementation for `Flop.Meta`. The function had been removed from the
  • protocol in Phoenix.HTML 4.0.
  • Remove the previously deprecated `event` attribute from the
  • + 5 more

๐Ÿ› Fixed

  • Fix a warning about ranges in Elixir 1.18.

๐Ÿ“ฆ How to upgrade

  • Replace `Flop.Phoenix.cursor_pagination/1` with `Flop.Phoenix.pagination/1`.
  • ```diff
  • <Flop.Phoenix.cursor_pagination meta={@meta} path={~p"/pets"} />
  • + <Flop.Phoenix.pagination meta={@meta} path={~p"/pets"} />
  • ```
  • Update the format of the `page_links` option for the pagination component.
  • ```diff
  • page_links: {:ellipsis, 7},
  • + 94 more
0.23.1
woyliewoylieยท1y agoยทOctober 18, 2024
GitHub

๐Ÿ“‹ Changed

  • Raise an error if a meta struct with the wrong pagination type is passed to the `pagination` or `cursor_pagination` component.

๐Ÿ› Fixed

  • Fix compilation error in Phoenix LiveView 1.0.0-rc.7.
  • Fix type of `row_click` attribute.
0.23.0
woyliewoylieยท1y agoยทAugust 18, 2024
GitHub

๐Ÿ“‹ Changed

  • Support and require `live_view ~> 1.0.0-rc.0`.
  • Allow to pass options directly in config file instead of referencing function.

๐Ÿ› Fixed

  • Fixed a deprecation warning in Elixir 1.17.
0.22.10
woyliewoylieยท1y agoยทAugust 18, 2024
GitHub

๐Ÿ“‹ Changed

  • Loosen version requirement for `flop` to support 0.26.
0.22.9
woyliewoylieยท2y agoยทMay 4, 2024
GitHub

โœจ Added

  • Added `:pagination_list_item_attrs` option to `Flop.Phoenix.pagination/1`.
0.22.8
woyliewoylieยท2y agoยทMarch 23, 2024
GitHub

โœจ Added

  • Support `:col_class` attr on `:col` and `:action` slots in addition to `:col_style`.

๐Ÿ“‹ Changed

  • Don't render empty `style` attributes on `col` elements in `colgroup`.

๐Ÿ› Fixed

  • The page range calculation in the `Flop.Phoenix.pagination/1` was incorrect
  • towards the last pages.
0.22.7
woyliewoylieยท2y agoยทMarch 2, 2024
GitHub

๐Ÿ“‹ Changed

  • Loosen version requirement for `phoenix_html`.

๐Ÿ› Fixed

  • Warning when wrapping table component and passing on `:col` slot as attribute.
0.22.6
woyliewoylieยท2y agoยทJanuary 14, 2024
GitHub

๐Ÿ“‹ Changed

  • Support Flop 0.25.0.
  • Update documentation examples for filter forms.
0.22.5
woyliewoylieยท2y agoยทDecember 24, 2023
GitHub

๐Ÿ“‹ Changed

  • Requires `phoenix_html ~> 4.0`.
0.22.4
woyliewoylieยท2y agoยทNovember 18, 2023
GitHub

๐Ÿ› Fixed

  • Don't render `li` element if a pagination link is not rendered.
0.22.3
woyliewoylieยท2y agoยทNovember 14, 2023
GitHub

๐Ÿ“‹ Changed

  • Support Flop ~> 0.24.0.
0.22.2
woyliewoylieยท2y agoยทOctober 19, 2023
GitHub

๐Ÿ› Fixed

  • Numbered pagination links were not wrapped in `li` elements.
0.22.1
woyliewoylieยท2y agoยทSeptember 28, 2023
GitHub

๐Ÿ“‹ Changed

  • Allow to use `t:Phoenix.HTML.safe/0` as a label attribute in table headers.
0.22.0
woyliewoylieยท2y agoยทSeptember 26, 2023
GitHub

โœจ Added

  • Added `directions` attribute to the `col` slot of the table component. This
  • allows you to override the default sort directions, e.g. to specify
  • nulls-first or nulls-last.
  • Added `thead_th_attrs` and `th_wrapper_attrs` attributes to the `col` slot
  • of the table component.
  • Added `thead_th_attrs` attribute to the `action` slot of the table component.

๐Ÿ“‹ Changed

  • Renamed `attrs` mattribute on the `col` and `action` slots of the table
  • component to `tbody_td_attrs` in order to match the naming of the global
  • table options.

๐Ÿ“ฆ Upgrade guide

  • Rename the `attrs` attribute to `tbody_td_attrs` in both the `col` slot and the
  • `action` slot:
  • ```diff
  • <Flop.Phoenix.table items={@pets} meta={@meta} path={~p"/pets"}>
  • <:col :let={p} attrs={[class="my-class"]}><%= p.id %></:col>
  • <:action :let={p} attrs={[class="my-class"]}>button</:col>
  • + <:col :let={p} tbody_td_attrs={[class="my-class"]}><%= p.id %></:col>
  • + <:action :let={p} tbody_td_attrs={[class="my-class"]}>button</:col>
  • + 2 more
0.21.2
woyliewoylieยท2y agoยทSeptember 26, 2023
GitHub

๐Ÿ“‹ Changed

  • Support `phoenix_liveview ~> 0.20`.
0.21.1
woyliewoylieยท2y agoยทAugust 5, 2023
GitHub

โœจ Added

  • Allow passing a function to the `attrs` option of table component's `:action`
  • slot. Before, this was only supported in the `:col` slot.

๐Ÿ“‹ Changed

  • Improve some error messages and documentation examples.

๐Ÿ› Fixed

  • In the `:col` and `:action` slots of the table component, the `attrs` option
  • did not properly override the attributes set with the `:tbody_td_attrs`
  • option.
0.21.0
woyliewoylieยท2y agoยทJuly 17, 2023
GitHub

๐Ÿ“‹ Changed

  • Depend on flop ~> 0.22.0.
0.20.0
woyliewoylieยท2y agoยทJuly 9, 2023
GitHub

โœจ Added

  • Added an `on_paginate` attribute to the `pagination` and `cursor_pagination`
  • components. This attribute takes a `Phoenix.LiveView.JS` command as a value.
  • The attribute can be combined with the `path` attribute, in which case the URL
  • will be patched _and_ the the given JS command is executed.
  • Similarly, an `on_sort` attribute was added to the `table` component.
  • Allow setting `tbody_tr_attrs` to a function that takes the current row item
  • as an argument and returns a list of attributes.
  • Allow setting the `attrs` attribute of the `:col` slot of the table component
  • + 2 more

๐Ÿ“‹ Changed

  • The table ID falls back to `"sortable-table"` if no schema module is used.
  • The tbody ID was changed to `{id}-tbody`.
  • The table container ID is set to `{id}-container` now.
  • The table ID is set to `{id}` now.

๐Ÿ—‘๏ธ Deprecated

  • The `show` and `hide` attributes of the `:col` slot of the table component are
  • now deprecated in favor of the `:if` attribute.
  • The `event` attribute of the pagination, cursor pagination and table
  • components has been deprecated in favor of `on_pagination` and `on_sort`.
0.19.1
woyliewoylieยท2y agoยทJune 30, 2023
GitHub

๐Ÿ“‹ Changed

  • The table component only renders an ascending/descending order indicator in the column header for the first order field, instead rendering one in the column headers for all ordered fields.
  • Support Flop 0.22.
0.19.0
woyliewoylieยท3y agoยทMay 29, 2023
GitHub

๐Ÿ“‹ Changed

  • Necessary updates for `phoenix_live_view ~> 0.19.0`.
  • Requires `phoenix_live_view ~> 0.19.0`.
  • Remove previously deprecated `Flop.Phoenix.pop_filter/2`. Use
  • `Flop.Filter.pop/3` instead.
0.18.2
woyliewoylieยท3y agoยทMay 7, 2023
GitHub

๐Ÿ“‹ Changed

  • Added `hidden` attribute to hidden inputs rendered by `filter_fields`
  • component in order to solve CSS spacing issues.
0.18.1
woyliewoylieยท3y agoยทMarch 18, 2023
GitHub

๐Ÿ“‹ Changed

  • Added support for LiveView streams to the table component. To this end,
  • `row_id`, `row_item` and `id` attributes were added to the component,
  • following the example of Phoenix 1.7. The `id` attribute is added to the
  • `tbody`. If no `id` is explicitly set, a default value will be used depending
  • on the schema name.
0.18.0
woyliewoylieยท3y agoยทFebruary 25, 2023
GitHub

๐Ÿ“‹ Changed

  • Added dependency on `Phoenix.HTML` `~> 3.3.0`.
  • The `filter_fields` component now passes the `Phoenix.HTML.FormField` struct
  • introduced in `Phoenix.HTML` 3.3.0 to the inner block.
  • Support `:as` option for filter inputs with `Phoenix.HTML.FormData/4`
  • (`inputs_for`).
  • `Phoenix.HTML.FormData.input_type/2` now considers the Ecto type for join,
  • custom and compound fields.
  • Remove support for `path_helper` assigns, previously deprecated in 0.15.
  • + 1 more

๐Ÿ“ฆ How to upgrade

  • If your `input` component already knows how to handle the
  • `Phoenix.HTML.FormField` struct, you can update the inner block for
  • `filter_fields` like this:
  • ```diff
  • <.filter_fields :let={i} form={f} fields={[:email, :name]}>
  • <.input
  • field={{i.form, i.field}}
  • + field={i.field}
  • + 30 more
0.17.2
woyliewoylieยท3y agoยทJanuary 15, 2023
GitHub

๐Ÿ“‹ Changed

  • Support Flop 0.19.