Cinder.PageSize (Cinder v0.13.0)

Copy Markdown View Source

Page size configuration for Cinder table components.

Configuration

Set a global default page size in your application configuration:

# config/config.exs
config :cinder, default_page_size: 50

# Or with configurable options (shows dropdown selector)
config :cinder, default_page_size: [default: 25, options: [10, 25, 50, 100]]

Individual tables can override the global default:

<Cinder.collection page_size={100} ...>
</Cinder.collection>

Summary

Functions

Gets the raw default page size from application configuration.

Parses a page size value into a standardized config map.

Validates a requested page size against the table's configuration.

Functions

get_default_page_size()

Gets the raw default page size from application configuration.

Returns the configured value or 25 if not set.

parse(value)

Parses a page size value into a standardized config map.

Accepts an integer, keyword list with :default and :options keys, or nil to use the global default.

validate(requested, map)

@spec validate(term(), map()) :: integer()

Validates a requested page size against the table's configuration.

Non-configurable tables (e.g. page_size={100}) ignore any requested value and always return the developer's configured size — the user has no UI to change it, so the URL must not be able to either.

Configurable tables accept only values present in page_size_options; any other value falls back to default_page_size.