Skip to content
Reeflow
Start Building

Select Control

The <reeflow-select> component provides single or multi-select dropdowns. Options can be defined statically in HTML or loaded dynamically from a JSONQL query. Its value is available to queries via RF_PARAM() using its control-id.

Define options directly as <option> children:

import { ReeflowProvider, ReeflowSelect, ReeflowTable } from '@reeflow/react';
<ReeflowProvider authToken="your-token">
<ReeflowSelect controlId="status" label="Status">
<option value="active" selected>
Active
</option>
<option value="inactive">Inactive</option>
<option value="archived">Archived</option>
</ReeflowSelect>
<ReeflowTable
title="Orders"
query={{
type: 'table',
columns: [{ name: 'orders.id' }, { name: 'orders.customer' }],
filters: [
{
column: 'orders.status',
operator: 'equals',
values: ["RF_PARAM('status')"],
},
],
}}
/>
</ReeflowProvider>;

Load options dynamically from the database. Use value-column and label-column to map query result columns to option values and labels:

import { ReeflowSelect } from '@reeflow/react';
<ReeflowSelect
controlId="region"
label="Region"
valueColumn="id"
labelColumn="name"
query={{
type: 'table',
columns: [{ name: 'regions.id' }, { name: 'regions.name' }],
}}
/>;
AttributeTypeDefaultDescription
control-idstringRequired. Unique identifier used in RF_PARAM() references
labelstringDisplay label above the select
valuestring | string[]Current or initial value
multiplebooleanfalseEnable multi-select mode
value-columnstringColumn name to use as option value (required for query-based options)
label-columnstringColumn name to use as option label (defaults to value-column)
distinctbooleanfalseRemove duplicate options based on value
disabledbooleanfalseDisable the select
readonlybooleanfalseMake the select read-only
requiredbooleanfalseMark the select as required

Enable multiple to allow selecting several values. The control value becomes an array:

<ReeflowSelect controlId="categories" label="Categories" multiple>
<option value="electronics">Electronics</option>
<option value="clothing">Clothing</option>
<option value="books">Books</option>
</ReeflowSelect>;
EventDetailDescription
reeflow-select-value-change{ controlId, value, previousValue }Fired when selection changes
reeflow-select-options-loaded{ controlId, options }Fired when query-based options finish loading