Skip to content

SettingsBuilder Components ​

Overview ​

This section contains all components and utilities for SettingsBuilder Components.

Components ​

ItemTypeDescription
SectionClassHandle for configuring a settings section.
Badge FieldClassHandle for configuring a badge display field.
Button FieldClassHandle for configuring a button field.
Info FieldClassHandle for configuring an info display field.
Input FieldClassHandle for configuring an input field.
Link FieldClassHandle for configuring a link button field.
Select FieldClassHandle for configuring a select dropdown field.
Switch FieldClassHandle for configuring a switch field.
Text FieldClassHandle for configuring a text display field.

Section ​

Handle for configuring a settings section.

Provides methods to configure section properties like name, visibility, and expandability.

Methods ​

MethodParametersDescription
setDisabled()disabled: booleanSets the disabled state of the section..
setExpandable()expandable: booleanSets the expandable state of the section.
setExpanded()expanded: booleanSets the expanded state of the section.
setHidden()hidden: booleanSets the hidden state of the section..
setName()name: stringSets the name of the section..

setDisabled() ​

typescript
setDisabled(disabled: boolean): this

Sets the disabled state of the section.

Parameters:

NameTypeRequiredDescription
disabledbooleanYesThe disabled state of the section

Returns:

this - The SectionHandle for method chaining

setExpandable() ​

typescript
setExpandable(expandable: boolean): this

Sets the expandable state of the section. When set to true, the section will render as an expandable section.

Parameters:

NameTypeRequiredDescription
expandablebooleanYesThe expandable state of the section

Returns:

this - The SectionHandle for method chaining

setExpanded() ​

typescript
setExpanded(expanded: boolean): this

Sets the expanded state of the section. When set to true, the section will be expanded. When set to false, the section will be collapsed.

Parameters:

NameTypeRequiredDescription
expandedbooleanYesThe expanded state of the section

Returns:

this - The SectionHandle for method chaining

setHidden() ​

typescript
setHidden(hidden: boolean): this

Sets the hidden state of the section.

Parameters:

NameTypeRequiredDescription
hiddenbooleanYesThe hidden state of the section

Returns:

this - The SectionHandle for method chaining

setName() ​

typescript
setName(name: string): this

Sets the name of the section.

Parameters:

NameTypeRequiredDescription
namestringYesThe name of the section

Returns:

this - The SectionHandle for method chaining


Badge Field ​

Handle for configuring a badge display field.

Returned by SettingsBuilder.addBadge. Provides methods to configure badge properties like label, text content, and style.

Live Examples ​

View Examples

Methods ​

MethodParametersDescription
assign()props: PartialBulk assigns multiple properties to the badge field..
setDesc()description: stringSets the help text displayed below the badge..
setLabel()label: stringSets the label of the badge..
setStyle()style: "info" | "success" | "warning" | "error" | "default" | "muted" | undefinedSets the visual style and color of the badge..
setText()text: stringSets the text content of the badge..

assign() ​

typescript
assign(props: Partial): this

Bulk assigns multiple properties to the badge field.

Parameters:

NameTypeRequiredDescription
propsPartialYesObject containing properties to assign

Returns:

this - The BadgeFieldHandle for method chaining

setDesc() ​

typescript
setDesc(description: string): this

Sets the help text displayed below the badge.

Parameters:

NameTypeRequiredDescription
descriptionstringYesThe description text to display

Returns:

this - The BadgeFieldHandle for method chaining

setLabel() ​

typescript
setLabel(label: string): this

Sets the label of the badge.

Parameters:

NameTypeRequiredDescription
labelstringYesThe label text to display

Returns:

this - The BadgeFieldHandle for method chaining

setStyle() ​

typescript
setStyle(style: "info" \| "success" \| "warning" \| "error" \| "default" \| "muted" \| undefined): this

Sets the visual style and color of the badge.

Parameters:

NameTypeRequiredDescription
style"info" \| "success" \| "warning" \| "error" \| "default" \| "muted" \| undefinedYesThe badge style (default, muted, info, success, warning, error)

Returns:

this - The BadgeFieldHandle for method chaining

setText() ​

typescript
setText(text: string): this

Sets the text content of the badge.

Parameters:

NameTypeRequiredDescription
textstringYesThe text to display in the badge

Returns:

this - The BadgeFieldHandle for method chaining


Button Field ​

Handle for configuring a button field.

Returned by SettingsBuilder.addButton. Provides methods to configure button properties like title, label, style, and click handlers.

Live Examples ​

View Examples

Methods ​

MethodParametersDescription
assign()props: PartialBulk assigns multiple properties to the button field..
onClick()onClick: () => voidRegisters a callback function that is called when the button is clicked..
setDesc()description: stringSets the help text displayed below the button..
setLabel()label: stringSets the label text displayed beside the button..
setStyle()style: "primary" | "secondary" | "danger" | undefinedSets the visual style of the button..
setTitle()title: stringSets the text displayed on the button..

assign() ​

typescript
assign(props: Partial): this

Bulk assigns multiple properties to the button field.

Parameters:

NameTypeRequiredDescription
propsPartialYesObject containing properties to assign

Returns:

this - The ButtonFieldHandle for method chaining

onClick() ​

typescript
onClick(onClick: () => void): this

Registers a callback function that is called when the button is clicked.

Parameters:

NameTypeRequiredDescription
onClick() => voidYesFunction called on button click

Returns:

this - The ButtonFieldHandle for method chaining

setDesc() ​

typescript
setDesc(description: string): this

Sets the help text displayed below the button.

Parameters:

NameTypeRequiredDescription
descriptionstringYesThe description text to display

Returns:

this - The ButtonFieldHandle for method chaining

setLabel() ​

typescript
setLabel(label: string): this

Sets the label text displayed beside the button.

Parameters:

NameTypeRequiredDescription
labelstringYesThe label text to display

Returns:

this - The ButtonFieldHandle for method chaining

setStyle() ​

typescript
setStyle(style: "primary" \| "secondary" \| "danger" \| undefined): this

Sets the visual style of the button.

Parameters:

NameTypeRequiredDescription
style"primary" \| "secondary" \| "danger" \| undefinedYesThe button style (primary, secondary, danger)

Returns:

this - The ButtonFieldHandle for method chaining

setTitle() ​

typescript
setTitle(title: string): this

Sets the text displayed on the button.

Parameters:

NameTypeRequiredDescription
titlestringYesThe text to display on the button

Returns:

this - The ButtonFieldHandle for method chaining


Info Field ​

Handle for configuring an info display field.

Returned by SettingsBuilder.addInfo. Provides methods to configure info properties like text content and style.

Methods ​

MethodParametersDescription
assign()props: PartialBulk assigns multiple properties to the info field..
setStyle()style: "info" | "success" | "warning" | "error" | "default" | undefinedSets the visual style and color of the info banner..
setText()text: stringSets the text content of the info banner..
useIcon()show: booleanControls whether the icon is displayed in the info banner..

assign() ​

typescript
assign(props: Partial): this

Bulk assigns multiple properties to the info field.

Parameters:

NameTypeRequiredDescription
propsPartialYesObject containing properties to assign

Returns:

this - The InfoFieldHandle for method chaining

setStyle() ​

typescript
setStyle(style: "info" \| "success" \| "warning" \| "error" \| "default" \| undefined): this

Sets the visual style and color of the info banner.

Parameters:

NameTypeRequiredDescription
style"info" \| "success" \| "warning" \| "error" \| "default" \| undefinedYesThe info style (default, info, success, warning, error)

Returns:

this - The InfoFieldHandle for method chaining

setText() ​

typescript
setText(text: string): this

Sets the text content of the info banner.

Parameters:

NameTypeRequiredDescription
textstringYesThe text to display in the info banner

Returns:

this - The InfoFieldHandle for method chaining

useIcon() ​

typescript
useIcon(show: boolean): this

Controls whether the icon is displayed in the info banner.

Parameters:

NameTypeRequiredDescription
showbooleanYesWhether to show the icon (default: true)

Returns:

this - The InfoFieldHandle for method chaining


Input Field ​

Handle for configuring an input field.

Returned by SettingsBuilder.addInput. Provides methods to configure input properties like type, placeholder, value, validation, and change handlers.

Live Examples ​

View Examples

Methods ​

MethodParametersDescription
assign()props: PartialBulk assigns multiple properties to the input field..
onChange()callback: (data: any) => voidRegisters a callback function that is called when the input value changes..
setDesc()description: stringSets the help text displayed below the input field..
setDisabled()disabled: booleanSets the disabled state of the input field..
setLabel()label: stringSets the label of the input field..
setMax()max: numberSets the maximum value for number input types..
setMin()min: numberSets the minimum value for number input types..
setName()name: stringSets the label of the input field (alias for setLabel)..
setPlaceholder()placeholder: stringSets the placeholder text shown in the input field..
setRequired()required: booleanMarks the input field as required..
setType()type: "number" | "text" | "password" | "textarea" | "color" | "file" | "ip_address" | "mac_address"Sets the input type (text, password, number, etc.)..
setValue()value: anySets the default or current value of the input field..

assign() ​

typescript
assign(props: Partial): this

Bulk assigns multiple properties to the input field.

Parameters:

NameTypeRequiredDescription
propsPartialYesObject containing properties to assign

Returns:

this - The InputFieldHandle for method chaining

onChange() ​

typescript
onChange(callback: (data: any) => void): this

Registers a callback function that is called when the input value changes.

Parameters:

NameTypeRequiredDescription
callback(data: any) => voidYesFunction called with the new value

Returns:

this - The InputFieldHandle for method chaining

setDesc() ​

typescript
setDesc(description: string): this

Sets the help text displayed below the input field.

Parameters:

NameTypeRequiredDescription
descriptionstringYesThe description text to display

Returns:

this - The InputFieldHandle for method chaining

setDisabled() ​

typescript
setDisabled(disabled: boolean): this

Sets the disabled state of the input field.

Parameters:

NameTypeRequiredDescription
disabledbooleanYesWhether the field is disabled

Returns:

this - The InputFieldHandle for method chaining

setLabel() ​

typescript
setLabel(label: string): this

Sets the label of the input field.

Parameters:

NameTypeRequiredDescription
labelstringYesThe label text to display

Returns:

this - The InputFieldHandle for method chaining

setMax() ​

typescript
setMax(max: number): this

Sets the maximum value for number input types.

Parameters:

NameTypeRequiredDescription
maxnumberYesThe maximum allowed value

Returns:

this - The InputFieldHandle for method chaining

setMin() ​

typescript
setMin(min: number): this

Sets the minimum value for number input types.

Parameters:

NameTypeRequiredDescription
minnumberYesThe minimum allowed value

Returns:

this - The InputFieldHandle for method chaining

setName() ​

typescript
setName(name: string): this

Sets the label of the input field (alias for setLabel).

Parameters:

NameTypeRequiredDescription
namestringYesThe label text to display

Returns:

this - The InputFieldHandle for method chaining

setPlaceholder() ​

typescript
setPlaceholder(placeholder: string): this

Sets the placeholder text shown in the input field.

Parameters:

NameTypeRequiredDescription
placeholderstringYesThe placeholder text to display

Returns:

this - The InputFieldHandle for method chaining

setRequired() ​

typescript
setRequired(required: boolean): this

Marks the input field as required.

Parameters:

NameTypeRequiredDescription
requiredbooleanYesWhether the field is required

Returns:

this - The InputFieldHandle for method chaining

setType() ​

typescript
setType(type: "number" \| "text" \| "password" \| "textarea" \| "color" \| "file" \| "ip_address" \| "mac_address"): this

Sets the input type (text, password, number, etc.).

Parameters:

NameTypeRequiredDescription
type"number" \| "text" \| "password" \| "textarea" \| "color" \| "file" \| "ip_address" \| "mac_address"YesThe input type

Returns:

this - The InputFieldHandle for method chaining

setValue() ​

typescript
setValue(value: any): this

Sets the default or current value of the input field.

Parameters:

NameTypeRequiredDescription
valueanyYesThe value to set

Returns:

this - The InputFieldHandle for method chaining


Handle for configuring a link button field.

Returned by SettingsBuilder.addLink. Provides methods to configure link properties like URL, button text, icon, and label.

The button displays the provided icon (or a default link icon) and on hover swaps it with an external-link indicator to signal that the URL opens in a new tab.

Live Examples ​

View Examples

Methods ​

MethodParametersDescription
assign()props: Partial<LinkField>Bulk assigns multiple properties to the link field.
setDesc()description: stringSets the help text displayed below the link button.
setHref()href: stringSets the URL that opens when the link is clicked.
setIcon()icon: stringSets the Font Awesome icon class for the link button.
setLabel()label: stringSets the label text displayed beside the link button.
setText()text: stringSets the text displayed on the link button.

assign() ​

typescript
assign(props: Partial<LinkField>): this

Bulk assigns multiple properties to the link field.

Parameters:

NameTypeRequiredDescription
propsPartial<LinkField>YesObject containing properties to assign

Returns:

this - The LinkFieldHandle for method chaining

setDesc() ​

typescript
setDesc(description: string): this

Sets the help text displayed below the link button.

Parameters:

NameTypeRequiredDescription
descriptionstringYesThe description text to display

Returns:

this - The LinkFieldHandle for method chaining

setHref() ​

typescript
setHref(href: string): this

Sets the URL that opens when the link button is clicked. Always opens in a new tab.

Parameters:

NameTypeRequiredDescription
hrefstringYesThe full URL to open

Returns:

this - The LinkFieldHandle for method chaining

setIcon() ​

typescript
setIcon(icon: string): this

Sets the Font Awesome icon class displayed on the link button. On hover the icon is replaced with an external-link indicator.

Parameters:

NameTypeRequiredDescription
iconstringYesFont Awesome class string, e.g. 'fas fa-book'

Returns:

this - The LinkFieldHandle for method chaining

setLabel() ​

typescript
setLabel(label: string): this

Sets the label text displayed beside the link button.

Parameters:

NameTypeRequiredDescription
labelstringYesThe label text to display

Returns:

this - The LinkFieldHandle for method chaining

setText() ​

typescript
setText(text: string): this

Sets the text displayed on the link button. Defaults to the href value if not set.

Parameters:

NameTypeRequiredDescription
textstringYesThe button label text

Returns:

this - The LinkFieldHandle for method chaining


Select Field ​

Handle for configuring a select dropdown field.

Returned by SettingsBuilder.addSelect. Provides methods to configure select properties like label, options, value, and change handlers.

Live Examples ​

View Examples

Methods ​

MethodParametersDescription
assign()props: PartialBulk assigns multiple properties to the select field..
onChange()callback: (data: any) => voidRegisters a callback function that is called when the selected value changes..
setDesc()description: stringSets the help text displayed below the select field..
setDisabled()disabled: booleanSets the disabled state of the select field..
setLabel()label: stringSets the label of the select field..
setOptions()options: any[] | string | number[]Sets the selectable options for the dropdown menu..
setPlaceholder()placeholder: stringSets the placeholder text shown when no option is selected..
setRequired()required: booleanMarks the select field as required..
setValue()value: anySets the default selected value of the select field..

assign() ​

typescript
assign(props: Partial): this

Bulk assigns multiple properties to the select field.

Parameters:

NameTypeRequiredDescription
propsPartialYesObject containing properties to assign

Returns:

this - The SelectFieldHandle for method chaining

onChange() ​

typescript
onChange(callback: (data: any) => void): this

Registers a callback function that is called when the selected value changes.

Parameters:

NameTypeRequiredDescription
callback(data: any) => voidYesFunction called with the newly selected value

Returns:

this - The SelectFieldHandle for method chaining

setDesc() ​

typescript
setDesc(description: string): this

Sets the help text displayed below the select field.

Parameters:

NameTypeRequiredDescription
descriptionstringYesThe description text to display

Returns:

this - The SelectFieldHandle for method chaining

setDisabled() ​

typescript
setDisabled(disabled: boolean): this

Sets the disabled state of the select field.

Parameters:

NameTypeRequiredDescription
disabledbooleanYesWhether the field is disabled

Returns:

this - The SelectFieldHandle for method chaining

setLabel() ​

typescript
setLabel(label: string): this

Sets the label of the select field.

Parameters:

NameTypeRequiredDescription
labelstringYesThe label text to display

Returns:

this - The SelectFieldHandle for method chaining

setOptions() ​

typescript
setOptions(options: any[] \| string \| number[]): this

Sets the selectable options for the dropdown menu.

Parameters:

NameTypeRequiredDescription
optionsany[] \| string \| number[]YesArray of options as objects with value/label or simple values

Returns:

this - The SelectFieldHandle for method chaining

setPlaceholder() ​

typescript
setPlaceholder(placeholder: string): this

Sets the placeholder text shown when no option is selected.

Parameters:

NameTypeRequiredDescription
placeholderstringYesThe placeholder text to display

Returns:

this - The SelectFieldHandle for method chaining

setRequired() ​

typescript
setRequired(required: boolean): this

Marks the select field as required.

Parameters:

NameTypeRequiredDescription
requiredbooleanYesWhether the field is required

Returns:

this - The SelectFieldHandle for method chaining

setValue() ​

typescript
setValue(value: any): this

Sets the default selected value of the select field.

Parameters:

NameTypeRequiredDescription
valueanyYesThe value to set as selected

Returns:

this - The SelectFieldHandle for method chaining


Switch Field ​

Handle for configuring a switch field.

Returned by SettingsBuilder.addSwitch. Provides methods to configure switch properties like label, value, description, and change handlers.

Live Examples ​

View Examples

Methods ​

MethodParametersDescription
assign()props: PartialBulk assigns multiple properties to the switch field..
onChange()callback: (data: any) => voidRegisters a callback function that is called when the switch state changes..
setDesc()description: stringSets the help text displayed below the switch..
setDisabled()disabled: booleanSets the disabled state of the switch..
setLabel()label: stringSets the label of the switch..
setRequired()required: booleanMarks the switch as required..
setValue()value: booleanSets the default or current state of the switch (on/off)..

assign() ​

typescript
assign(props: Partial): this

Bulk assigns multiple properties to the switch field.

Parameters:

NameTypeRequiredDescription
propsPartialYesObject containing properties to assign

Returns:

this - The SwitchFieldHandle for method chaining

onChange() ​

typescript
onChange(callback: (data: any) => void): this

Registers a callback function that is called when the switch state changes.

Parameters:

NameTypeRequiredDescription
callback(data: any) => voidYesFunction called with the new switch state

Returns:

this - The SwitchFieldHandle for method chaining

setDesc() ​

typescript
setDesc(description: string): this

Sets the help text displayed below the switch.

Parameters:

NameTypeRequiredDescription
descriptionstringYesThe description text to display

Returns:

this - The SwitchFieldHandle for method chaining

setDisabled() ​

typescript
setDisabled(disabled: boolean): this

Sets the disabled state of the switch.

Parameters:

NameTypeRequiredDescription
disabledbooleanYesWhether the switch is disabled

Returns:

this - The SwitchFieldHandle for method chaining

setLabel() ​

typescript
setLabel(label: string): this

Sets the label of the switch.

Parameters:

NameTypeRequiredDescription
labelstringYesThe label text to display

Returns:

this - The SwitchFieldHandle for method chaining

setRequired() ​

typescript
setRequired(required: boolean): this

Marks the switch as required.

Parameters:

NameTypeRequiredDescription
requiredbooleanYesWhether the switch is required

Returns:

this - The SwitchFieldHandle for method chaining

setValue() ​

typescript
setValue(value: boolean): this

Sets the default or current state of the switch (on/off).

Parameters:

NameTypeRequiredDescription
valuebooleanYesThe boolean state of the switch

Returns:

this - The SwitchFieldHandle for method chaining


Text Field ​

Handle for configuring a text display field.

Returned by SettingsBuilder.addText. Provides methods to configure text properties like label, text content, and style.

Live Examples ​

View Examples

Methods ​

MethodParametersDescription
assign()props: PartialBulk assigns multiple properties to the text field..
setDesc()description: stringSets the help text displayed below the text display..
setLabel()label: stringSets the label of the text display..
setStyle()style: "info" | "success" | "warning" | "error" | "default" | "muted" | undefinedSets the visual style and color of the text..
setText()text: stringSets the text content to display..

assign() ​

typescript
assign(props: Partial): this

Bulk assigns multiple properties to the text field.

Parameters:

NameTypeRequiredDescription
propsPartialYesObject containing properties to assign

Returns:

this - The TextFieldHandle for method chaining

setDesc() ​

typescript
setDesc(description: string): this

Sets the help text displayed below the text display.

Parameters:

NameTypeRequiredDescription
descriptionstringYesThe description text to display

Returns:

this - The TextFieldHandle for method chaining

setLabel() ​

typescript
setLabel(label: string): this

Sets the label of the text display.

Parameters:

NameTypeRequiredDescription
labelstringYesThe label text to display

Returns:

this - The TextFieldHandle for method chaining

setStyle() ​

typescript
setStyle(style: "info" \| "success" \| "warning" \| "error" \| "default" \| "muted" \| undefined): this

Sets the visual style and color of the text.

Parameters:

NameTypeRequiredDescription
style"info" \| "success" \| "warning" \| "error" \| "default" \| "muted" \| undefinedYesThe text style (default, muted, info, success, warning, error)

Returns:

this - The TextFieldHandle for method chaining

setText() ​

typescript
setText(text: string): this

Sets the text content to display.

Parameters:

NameTypeRequiredDescription
textstringYesThe text to display

Returns:

this - The TextFieldHandle for method chaining