Storefront — Listing
Filter sidebar and sort bar for a product listing page.
The controls for a category / product listing page (PLP). Combine with product-grid to build the
full listing — see the listing page.
Preview
All products
8 products
New
Kitchen Stoneware Dinner Set (214) $78
Sale
Living Linen Table Throw (88) $44 $58
Pantry Cold-Press Olive Oil (312) $19
Kitchen Hand-Thrown Mug (156) $24
Home Wool Storage Basket (64) $52
Low stock
Living Beeswax Candle, Fig (203) $28
Kitchen Brass Serving Spoons (41) $36
Pantry Organic Sourdough Mix (122) $12
Install
bun x bosia@latest add block storefront/filter-sidebar
bun x bosia@latest add block storefront/sort-barsort-bar pulls @lucide/svelte for icons.
Usage
<script lang="ts">
import SortBar from "$lib/blocks/storefront/sort-bar/block.svelte";
import FilterSidebar from "$lib/blocks/storefront/filter-sidebar/block.svelte";
let sort = $state("Featured");
</script>
<SortBar title="All products" count={24} bind:sort />
<FilterSidebar categories={["Home", "Kitchen", "Pantry"]} />sort-bar exposes a bindable sort so the parent can reorder its grid. filter-sidebar keeps its
selections in local state — read them or lift them up as needed.
Source
src/lib/blocks/storefront/filter-sidebar/block.svelte · src/lib/blocks/storefront/sort-bar/block.svelte