FieldGroup
Attaches buttons and fields to each other: the children lose the inner radii, with CSS only.
On this page
Examples
Horizontal and vertical
Razor
<div class="flex flex-col items-center gap-6">
<KlyFieldGroup AriaLabel="Text alignment">
<KlyButton Label="Left" Variant="ButtonVariant.Outline" Color="KlyColor.Neutral" />
<KlyButton Label="Center" Variant="ButtonVariant.Outline" Color="KlyColor.Neutral" />
<KlyButton Label="Right" Variant="ButtonVariant.Outline" Color="KlyColor.Neutral" />
</KlyFieldGroup>
<KlyFieldGroup>
<KlyInput Placeholder="Search" aria-label="Search" />
<KlyButton Label="Go" />
</KlyFieldGroup>
<KlyFieldGroup Orientation="KlyOrientation.Vertical">
<KlyButton Label="Top" Variant="ButtonVariant.Subtle" Color="KlyColor.Neutral" />
<KlyButton Label="Bottom" Variant="ButtonVariant.Subtle" Color="KlyColor.Neutral" />
</KlyFieldGroup>
</div>API
KlyFieldGroup
Joins buttons, inputs and selects into one control by removing their inner radii. It is pure CSS.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
AriaLabel |
string |
Accessible name of the group, when it needs one. | |
Class |
string |
Classes added to the root element, merged last so they win over the theme. | |
Orientation |
KlyOrientation |
KlyOrientation. |
Whether the controls sit side by side ( Horizontal ) or stacked ( Vertical ). Values: Horizontal, Vertical. |
Ui |
FieldGroupUi |
Per-instance class overrides of the slots of the field group, see FieldGroupUi . They are merged after the theme and the Class parameter wins on the root slot. |
Slots
| Name | Type | Description |
|---|---|---|
ChildContent |
RenderFragment |
The controls to attach to each other: KlyButton , KlyInput , KlySelect … |
Ui slots
Ui takes a FieldGroupUi with one class string per slot, merged after the theme.
| Slot | Styles |
|---|---|
Base |
Classes merged into the base slot of KlyFieldGroup , after the theme and the app configuration. |