Query - ComponentsAPI reference for interacting with Semantic UI componentsboxAPI 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

Name Type Description
settings object Setting 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

Name Type Description
newSettings object Settings 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

Name Type Description
name string Name of the setting
value any Value 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