Ir al contenido

co-ref-field

Ver código
<co-ref-field label="Ejemplo"></co-ref-field>

Props

PropAtributoTipoDefaultDescripción
clearableclearablebooleantrue
createLabelcreate-labelstring | undefinedIf set, shows a "Create" button in the panel footer.
disableddisabledbooleanfalse
emptyMessageempty-messagestring'No results found'
footerPrimaryLabelfooter-primary-labelstring'Ok'Label for the primary footer button.
footerSecondaryLabelfooter-secondary-labelstring'New'Label for the secondary footer button.
helperTexthelper-textstring | undefined
iconLefticon-leftstring | undefined
labellabelstring | undefined
layoutlayout"horizontal" | "vertical"'vertical'Label layout: vertical (label above) or horizontal (label beside)
loadingloadingbooleanfalseWhether the host is fetching data.
maxChipsmax-chipsnumber0Max chips visible in multiple mode before the "+N" badge. `0` (default) = responsive: the trigger stays single-line and shows as many chips as actually fit its current width (ResizeObserver-driven); the badge counts the rest. Set `> 0` to force a fixed cap instead.
multiplemultiplebooleanfalse
optionsoptionsstring'[]'JSON array of options to display: RefFieldOption[]
panelThemepanel-theme"auto" | "dark" | "light"'auto'Panel color theme. 'auto' follows trigger, 'dark' forces dark panel, 'light' forces light.
placeholderplaceholderstring'Select…'
requiredrequiredbooleanfalseWhether the field is required (renders a required marker on the label).
searchDebouncesearch-debouncenumber350
searchPlaceholdersearch-placeholderstring'Search…'
searchablesearchablebooleantrue
secondaryLabelsecondary-labelstring | undefined
selectedDisplayselected-displaystring'[]'JSON array of display items for selected values: RefFieldDisplayItem[]
showFootershow-footerbooleanfalseShow footer buttons (same pattern as co-combobox).
sizesize"default" | "sm"'default'Size of the trigger. 'sm' reduces height to 32px.
statusstatus"default" | "error" | "success" | "warning"'default'
totaltotalnumber0Total count of matching records from the API.
valuevaluestring''Selected value: single ID string or JSON array of IDs.

Eventos

EventoDetailBubblesCancelableDescripción
coChange{ value: string | string[]; item: RefFieldOption; }
coClearvoid
coClosevoid
coCreatestring
coFooterPrimaryvoid
coFooterSecondaryvoid
coLoadMorevoid
coOpenvoid
coRemovestring
coSearchstring

Slots

Este componente no expone slots.

CSS Parts

Este componente no expone CSS parts.

CSS Custom Properties

Este componente no expone CSS custom properties.