Summary
B24FormField already exposes a #label slot, but it is undocumented and has no usage example. Developers reading the docs only see the label prop (a plain string) and have no signal that a richer, custom label is possible without overriding internals.
Current state (the slot exists)
src/runtime/components/FormField.vue declares and renders the slot:
// FormField.vue (slots interface)
export interface FormFieldSlots {
label?(props: { label: string | undefined }): VNode[]
// ...
}
<!-- FormField.vue (template) -->
<Label :for="id" data-slot="label" :class="b24ui.label({ class: props.b24ui?.label })">
<slot name="label" :label="props.label">
{{ props.label }}
</slot>
</Label>
So the capability is shipped and working — this is not a feature request to add the slot.
The gap
docs/content/docs/2.components/form-field.md documents only the label prop (the "Label" section). There is:
- no mention of the
#label slot,
- no example showing a rich label (e.g. label text + a trailing help/info icon or tooltip, a badge, or an inline link).
This is the real-world need behind "rich labels" that comes up in record-edit / CRM forms (e.g. a field label with a help tooltip next to it).
Proposed changes
- Add a "Label slot" subsection to
form-field.md with a ::component-code example, e.g. a label composed of text + a small help icon/tooltip via the #label slot.
- Note in the forms skill guideline that
#label is available for custom labels (one line + snippet).
- Optionally cross-link from the
label prop section to the slot section.
Out of scope / for discussion
A separate, distinct gap (not this issue): there is no built-in "titled, bordered field-group / fieldset" primitive for grouping several FormFields under one labeled box (the "Client" sub-section pattern). If we want that, it should be its own issue/PR for a B24FieldGroup-style fieldset variant — please confirm interest before scoping.
Context: surfaced while reviewing the record-edit form example (branch claude/bitrix24-ui-layout-U2iTb).
Summary
B24FormFieldalready exposes a#labelslot, but it is undocumented and has no usage example. Developers reading the docs only see thelabelprop (a plain string) and have no signal that a richer, custom label is possible without overriding internals.Current state (the slot exists)
src/runtime/components/FormField.vuedeclares and renders the slot:So the capability is shipped and working — this is not a feature request to add the slot.
The gap
docs/content/docs/2.components/form-field.mddocuments only thelabelprop (the "Label" section). There is:#labelslot,This is the real-world need behind "rich labels" that comes up in record-edit / CRM forms (e.g. a field label with a help tooltip next to it).
Proposed changes
form-field.mdwith a::component-codeexample, e.g. a label composed of text + a small help icon/tooltip via the#labelslot.#labelis available for custom labels (one line + snippet).labelprop section to the slot section.Out of scope / for discussion
A separate, distinct gap (not this issue): there is no built-in "titled, bordered field-group / fieldset" primitive for grouping several
FormFields under one labeled box (the "Client" sub-section pattern). If we want that, it should be its own issue/PR for aB24FieldGroup-style fieldset variant — please confirm interest before scoping.Context: surfaced while reviewing the record-edit form example (branch
claude/bitrix24-ui-layout-U2iTb).