package templates templ CollectionRules(user User, collection CollectionData) { Collection Rules - { collection.Name } - Bookhoard @Header(user, "/collections")
{ collection.Icon }

{ collection.Name }

⚡ Smart Rules evaluated live — the collection is always current, no refresh needed

Rules

A book is in the collection while it matches ANY enabled rule. Saving here takes effect immediately, everywhere the collection renders.

@Icon("filter", "h-6 w-6")

No Rules Yet

Add a rule to make this collection smart — it will then match the rule live, everywhere. Removing the last rule makes it static again.

Create New Rule

Uncheck to disable without deleting

Rule Examples

1

Add all Science Fiction books

Field: genre
Operator: equals
Value: Science Fiction
2

Add books from a specific series

Field: series
Operator: starts with
Value: Harry Potter
3

Add books published in a year range

Field: copyright_year
Operator: greater than
Value: 2020
}