Filter card component for Pure Admin.
Provides an expandable filter card with inline filters and a collapsible
advanced section, matching the Svelte FilterCard component.
Summary
Functions
Renders an expandable filter card with inline filters and optional advanced section.
Functions
Renders an expandable filter card with inline filters and optional advanced section.
Examples
<.filter_card>
<:filters>
<.input_wrapper>
<.input type="text" placeholder="Search..." />
</.input_wrapper>
</:filters>
</.filter_card>
<.filter_card
is_expanded={@filters_expanded}
on_toggle="toggle-filters"
on_clear="clear-filters"
on_refresh="refresh"
>
<:filters>
<.input_group style="flex: 1; min-width: 200px;">
<:prepend>🔍</:prepend>
<.input type="text" placeholder="Search..." />
</.input_group>
</:filters>
<:advanced_filters>
<.grid>
<.column size="100" md="1-3">
<.form_group>
<.form_label>Category</.form_label>
<.input_wrapper>
<.select prompt="All" options={["A", "B"]} />
</.input_wrapper>
</.form_group>
</.column>
</.grid>
</:advanced_filters>
</.filter_card>Attributes
is_expanded(:boolean) - Whether advanced filters are visible. Defaults tofalse.has_toggle(:boolean) - Show expand/collapse toggle button. Defaults totrue.has_clear(:boolean) - Show the clear all button. Defaults totrue.has_refresh(:boolean) - Show the refresh button. Defaults totrue.has_advanced_actions(:boolean) - Show Apply/Clear in advanced footer. Defaults totrue.is_disabled(:boolean) - Disable all filter interactions. Defaults tofalse.is_loading(:boolean) - Loading state (disables inputs, spins refresh). Defaults tofalse.on_toggle(:string) - phx-click event for toggle button. Defaults tonil.on_clear(:string) - phx-click event for clear button. Defaults tonil.on_refresh(:string) - phx-click event for refresh button. Defaults tonil.on_apply(:string) - phx-click event for apply button. Defaults tonil.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
filters(required) - Main inline filter controls.advanced_filters- Collapsible advanced filter section.actions- Custom action buttons before toggle.