Skip to main content

SpHelpText

Function SpHelpText 

Source
pub fn SpHelpText(_: SpHelpTextProps) -> Element
Expand description

Descriptive or validation text associated with a form control.

Maps to <sp-help-text>. Meaningless on its own — a form control like SpNumberfield renders it only when passed as that control’s children, with slot set to one of the two slot names the control’s own shadow DOM exposes: "help-text" for default/non-negative text, always rendered when present, or "negative-help-text" for text shown only while the control’s own invalid prop is true (confirmed against the bundled SWC source’s HelpTextManager.render, which switches which slot it exposes based on exactly that prop — the control ignores an sp-help-text slotted into "negative-help-text" whenever invalid is false). variant mirrors the element’s own variant property ("negative" renders the error/red treatment); note that slotting into "negative-help-text" sets this to "negative" automatically on the control’s own side, so passing it here is belt-and-suspenders, not load-bearing.

§Props

For details, see the props struct definition.