API reference
blocks/resource-select
Import
Section titled “Import”import * as api from "@fungi.computer/caps/blocks/resource-select";Exports
Section titled “Exports”| 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”type ResourceOption = object;Caller-provided resource option data.
Properties
Section titled “Properties”disabled?
Section titled “disabled?”optional disabled?: boolean;id: string;label: string;searchText?
Section titled “searchText?”optional searchText?: string;ResourceSelectPropstype alias
Section titled “ResourceSelectProps”type ResourceSelectProps = object;Props accepted by ResourceSelect.
Properties
Section titled “Properties”onSelect
Section titled “onSelect”onSelect: (option) => void;Called after an option is selected.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
option |
ResourceOption |
Returns
Section titled “Returns”void
options
Section titled “options”options: readonly ResourceOption[];placeholder?
Section titled “placeholder?”optional placeholder?: string;triggerProps?
Section titled “triggerProps?”optional triggerProps?: ButtonHTMLAttributes<HTMLButtonElement> & DataAttributes;Native caller metadata, including data-* attributes.
value?
Section titled “value?”optional value?: string;DataAttributestype alias
Section titled “DataAttributes”type DataAttributes = Record< `data-${string}`, boolean | number | string | undefined>;Native data-* attribute map accepted alongside typed props.
ResourceSelectconstant
Section titled “ResourceSelect”const ResourceSelect: ForwardRefExoticComponent< ResourceSelectProps & RefAttributes<HTMLButtonElement>>;A resource-selection block with caller-owned options and selected value.