Query - Components API reference for interacting with Semantic UI components box API Reference
Categories

Query - Components

Access and configure Semantic UI web components through Query.

Instances

component

$('selector').component()

Retrieves the component instance from a web component.

Returns

Component instance, or undefined if not found.

Example

initialize

$('selector').initialize(settings)

Initializes a component with settings before it renders in the DOM.

Parameters

NameTypeDescription
settingsobjectSetting key-value pairs

Returns

Query object for chaining.

Example

Settings

settings

$('selector').settings()
$('selector').settings(newSettings)

Gets or sets component settings. Useful for passing data that cannot be stringified into attributes.

Parameters

NameTypeDescription
newSettingsobjectSettings to apply

Returns

Settings object when getting, Query object when setting.

Example

setting

$('selector').setting(name)
$('selector').setting(name, value)

Gets or sets a single component setting.

Parameters

NameTypeDescription
namestringName of the setting
valueanyValue to set

Returns

Setting value when getting, Query object when setting.

Example

Data

dataContext

$('selector').dataContext()

Retrieves the data context associated with a component.

Returns

Data context object, or undefined if not found.

Example

Previous
Attributes
Next
Content