schema-components - v3.7.0
    Preparing search index...

    Function buildAriaAttrs

    • Build the ARIA attribute bundle for a renderer.

      • aria-required="true" whenever the field is non-optional.
      • aria-describedby=<hint-id> whenever a constraint hint applies.
      • aria-label=<description> when a non-empty description is supplied.

      Returns a plain Record<string, string> (rather than a typed attribute interface) so callers can spread the result into any JSX element type without per-element TypeScript widening.

      inputId and constraints together control whether aria-describedby is emitted. Pass undefined for constraints when the renderer never emits a constraint hint (e.g. boolean checkboxes); the helper then skips the attribute entirely. When the caller does emit a hint via buildHint(...), the aria-describedby id matches hintIdFor(inputId) so the wire-up holds end-to-end.

      Parameters

      Returns Record<string, string>