Skip to content
API reference

blocks/resource-select

Import
import * as api from "@fungi.computer/caps/blocks/resource-select";
Kind Export Description
type alias ResourceOption Caller-provided resource option data.
type alias ResourceSelectProps Props accepted by ResourceSelect.
type alias DataAttributes Native data-* attribute map accepted alongside typed props.
constant ResourceSelect A resource-selection block with caller-owned options and selected value.

ResourceOptiontype alias

Section titled “ResourceOption”
Signature
type ResourceOption = object;

Caller-provided resource option data.

Signature
optional disabled?: boolean;
Signature
id: string;
Signature
label: string;
Signature
optional searchText?: string;

ResourceSelectPropstype alias

Section titled “ResourceSelectProps”
Signature
type ResourceSelectProps = object;

Props accepted by ResourceSelect.

Signature
onSelect: (option) => void;

Called after an option is selected.

Parameter Type
option ResourceOption

void

Signature
options: readonly ResourceOption[];
Signature
optional placeholder?: string;
Signature
optional triggerProps?: ButtonHTMLAttributes<HTMLButtonElement> & DataAttributes;

Native caller metadata, including data-* attributes.

Signature
optional value?: string;

DataAttributestype alias

Section titled “DataAttributes”
Signature
type DataAttributes = Record<
`data-${string}`,
boolean | number | string | undefined
>;

Native data-* attribute map accepted alongside typed props.

ResourceSelectconstant

Section titled “ResourceSelect”
Signature
const ResourceSelect: ForwardRefExoticComponent<
ResourceSelectProps & RefAttributes<HTMLButtonElement>
>;

A resource-selection block with caller-owned options and selected value.