Ir al contenido

co-ref-field

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

Props

PropAtributoTipoDefaultDescripción
avatarShapeavatar-shape"circle" | "square"'circle'Shape of the leading avatar (selected value + option rows). Defaults to 'circle' (people refs); use 'square' for company/workspace refs — it renders a smooth squircle. The avatar border can be themed via --co-avatar-border-color.
clearableclearablebooleantrue
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
labelIconlabel-iconstring | undefinedPhosphor icon name rendered before the label text.
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" | "lg" | "md" | "s" | "sm"'md'Size of the trigger (mirrors co-input): s 28 / sm 32 / md 40 / lg 48. `'default'` is a deprecated alias of `'md'`, kept for backwards compatibility with the old `'default' | 'sm'` scale — use `'md'` instead.
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
coFooterPrimaryvoid
coFooterSecondaryvoid
coLoadMorevoid
coOpenvoid
coRemovestring
coSearchstring

Slots

Este componente no expone slots.

CSS Parts

PartDescripción
::part(trigger-chevron)
::part(trigger-clear)
::part(trigger-placeholder)
::part(trigger-text)

CSS Custom Properties

Este componente no expone CSS custom properties.