LiveFilter.Theme (LiveFilter v0.1.8)

Copy Markdown View Source

Theme definitions for LiveFilter command-style filter chips.

Provides three preset themes: :default, :minimal, and :bordered. Each theme defines CSS classes for different chip elements.

Usage

LiveFilter.Theme.get(:default, :chip)
# => "inline-flex items-center bg-base-100 border border-base-300 rounded-lg h-8"

Custom Themes

You can pass custom class overrides via the filter config or bar assigns.

Summary

Functions

Returns the list of available theme names.

Gets a CSS class string for the given theme and element.

Returns all classes for a given theme.

Functions

available_themes()

@spec available_themes() :: [atom()]

Returns the list of available theme names.

get(theme_name, element)

@spec get(atom(), atom()) :: String.t()

Gets a CSS class string for the given theme and element.

Elements

  • :chip - The outer chip container
  • :field - The field label section with icon
  • :operator - The operator dropdown trigger
  • :values - The values/badges section
  • :badge - Individual value badges
  • :remove - Remove button (both value and filter)
  • :icon - Default icon styling

Examples

iex> LiveFilter.Theme.get(:default, :chip)
"inline-flex items-center bg-base-100 border border-base-300 rounded-lg h-8 text-sm"

iex> LiveFilter.Theme.get(:bordered, :badge)
"badge badge-primary badge-sm gap-1"

get_theme(theme_name)

@spec get_theme(atom()) :: map()

Returns all classes for a given theme.