Skip to main content

FilterField

Function FilterField 

Source
pub fn FilterField(_: FilterFieldProps) -> Element
Expand description

A reactive filter input derived from HyleFiltersState.

Looks up the field definition in state.fields, reads the current value from state.form_data, and calls state.set_field on change.

By default it renders:

  • Boolean fields → <label> wrapping a <select> with “Any / Yes / No”
  • Reference fields → <label> wrapping a <select> populated from pre-resolved options
  • Array<Reference> fields → <fieldset>/<legend> with one checkbox per option
  • Everything else → <label> wrapping an <input type="text"> (or the input.kind hint from the blueprint, e.g. "search", "number")

Pass render to replace the default for a specific field:

FilterField {
    state: filters,
    field_key: "role",
    render: |props| rsx! { MySelectInput { props } },
}

§Props

  • state — the HyleFiltersState from use_filters
  • field_key — the field name to render
  • render — optional custom renderer receiving HyleFilterFieldProps

§Props

For details, see the props struct definition.