Field Label
When to use standalone vs composite inputs
- Use
catnip-field-labelwhen the control is not a Catnip input — native elements, third-party widgets, file uploads, grouped custom layouts. - Use composite label props on
catnip-input,catnip-input-date,catnip-input-number,catnip-input-phone, andcatnip-input-chipwhen Catnip owns the field. Those components embed the same label and wirehtml-for/idautomatically.
Wiring
html
<catnip-field-label html-for="country" required>
Country
</catnip-field-label>
<select id="country" required aria-required="true">…</select>html-foron the label must match the controlid.requiredon the label is visual only — setrequiredand/oraria-required="true"on the control.disabledon the label coordinates appearance only — set nativedisabledon the control.
Slots
action— end-aligned link or button (e.g. “Don’t know address?”). Project withslot="action"on a child such ascatnip-link.suffix— custom trailing content when you are not using theinfoprop. Wheninfois non-empty, it wins andsuffixis omitted.
Composite inputs use label.action and label.suffix for the same patterns.
Info tooltip
Pass a plain string to info to render the default info tooltip beside the title. For a custom anchor or tooltip body, leave info empty and use the suffix slot with catnip-tooltip.
Spacing
- Default — label includes bottom margin to the control.
flush— use when a parent wrapper already defines vertical rhythm (flexgap, stacked fields).
Helper / error copy
Standalone labels do not include supporting text. For Catnip-owned fields, use supporting-text on catnip-input, catnip-input-date, catnip-input-number, catnip-input-phone, or catnip-input-chip. For custom controls, use your own helper markup below the field until a public supporting-text primitive is available.