Reference

Configuration

Four knobs on PhlexForms.configure: theme, inference, variants, and the icon renderer.

PhlexForms.configure#

config/initializers/phlex_forms.rb
PhlexForms.configure do |c|
  c.theme            = :plain          # :daisy (default when daisyui is loaded), :plain, or a Theme
  c.infer_from_model = true            # the model-driven inference kill switch
  c.field_variants   = [:primary]      # global variants under every field's input
  c.icon_renderer    = PhlexForms::Configuration.glyphs_renderer
end

Reset with PhlexForms.reset_configuration! (handy in test suites).

The knobs#

KnobDefaultEffect
themedaisy when daisyui is loaded, else plainThe default theme. Accepts :daisy, :plain, or a PhlexForms::Theme instance. Per-form theme: and form_options theme: override it.
infer_from_modeltrueGates structure/column/validator inference. false restores pure attribute-name inference — the pre-inference rendering.
field_variants[]daisyUI variants prepended to every field's inner input, beneath form-level and call-site variants.
icon_rendererbundled inline SVGA callable ->(name, **opts) returning a renderable, used wherever the gem draws an icon.

Icons#

The default renderer is a bundled inline SVG, so the gem renders identically with no host setup. To resolve icons from your app's glyphs / rails_icons asset tree instead:

config/initializers/phlex_forms.rb
PhlexForms.configure do |c|
  c.icon_renderer = PhlexForms::Configuration.glyphs_renderer
end
glyphs is deliberately not the default: rails_icons reads SVGs from the host app's asset paths, which a minimal host has not set up — the inline default can never raise.