Skip to content

The open alternative to Salesforce, designed for AI.

11.5 KB
Raw Blame
{/*
 * _____                    _
 *|_   _|_      _____ _ __ | |_ _   _
 *  | | \ \ /\ / / _ \ '_ \| __| | | | Auto-generated file
 *  | |  \ V  V /  __/ | | | |_| |_| | DO NOT EDIT - changes will be overwritten
 *  |_|   \_/\_/ \___|_| |_|\__|\__, | Generated by: npx nx generate:ui twenty-docs
 *                              |___/
 *
 * This file is generated from the documentation data in packages/twenty-ui/generated.
 * To update it, edit the component prop types or design tokens in twenty-ui and run:
 *   npx nx generate:ui twenty-docs
 */}

<ParamField body="children" type="ReactNode">
  Custom trigger content. Replaces the selected country presentation while retaining shared trigger behavior.
</ParamField>

<ParamField body="className" type="string | ((state: PopoverTriggerState) =&gt; string | undefined)">
  Class applied to the trigger.
</ParamField>

<ParamField body="closeDelay" type="number" default="0">
  How long to wait before closing the popover that was opened on hover.
  Specified in milliseconds.

  Requires the `openOnHover` prop.
</ParamField>

<ParamField body="closeOnSelect" type="boolean">
  Closes the popup after a selection. Defaults to true. Cancelled selection keeps it open.
</ParamField>

<ParamField body="countries" type="readonly CountryChoice[]" required>
  Prepared country choices with unique stable string values, caller-owned labels, and optional decorative flags and disabled states. An empty string is a valid choice value.
</ParamField>

<ParamField body="defaultOpen" type="boolean">
  Whether the uncontrolled popup is initially open.
</ParamField>

<ParamField body="defaultPage" type="string">
  Dropdown page shown when the popup opens. Defaults to root.
</ParamField>

<ParamField body="defaultValue" type="string | null">
  Initial uncontrolled selected identifier. Defaults to null.
</ParamField>

<ParamField body="delay" type="number" default="300">
  How long to wait before the popover may be opened on hover. Specified in milliseconds.

  Requires the `openOnHover` prop.
</ParamField>

<ParamField body="disabled" type="boolean">
  Prevents opening and selection while the trigger stays focusable. An empty country list is also disabled.
</ParamField>

<ParamField body="id" type="string">
  ID of the trigger. Generated when omitted.
</ParamField>

<ParamField body="label" type="string">
  Optional visible label that names the trigger.
</ParamField>

<ParamField body="nativeButton" type="boolean" default="true">
  Whether the component renders a native `<button>` element when replacing it
  via the `render` prop.
  Set to `false` if the rendered element is not a button (e.g. `<div>`).
</ParamField>

<ParamField body="noCountryLabel" type="string">
  Text of the no-country choice, also displayed when no country is selected.
</ParamField>

<ParamField body="noResultsLabel" type="string">
  Text displayed when no choice matches the search.
</ParamField>

<ParamField body="onEscapeKeyDown" type="((event: DropdownDismissEvent) =&gt; void)">
  Called before Escape dismisses the popup. Call event.preventDefault() to keep it open.
</ParamField>

<ParamField body="onInteractOutside" type="((event: DropdownDismissEvent) =&gt; void)">
  Called before outside interaction or Tab dismisses the popup. Call event.preventDefault() to keep it open.
</ParamField>

<ParamField body="onOpenChange" type="((open: boolean) =&gt; void)">
  Reports popup opening and closing with the next boolean state, matching Dropdown.Root.
</ParamField>

<ParamField body="onValueChange" type="((value: string | null, eventDetails: DropdownSelectionGroupChangeEventDetails) =&gt; void)">
  Reports the selected identifier or null with cancellable event details. Call details.cancel() to preserve selection and keep the popup open.
</ParamField>

<ParamField body="open" type="boolean">
  Controls whether the country popup is open.
</ParamField>

<ParamField body="openOnHover" type="boolean" default="false">
  Whether the popover should also open when the trigger is hovered.
</ParamField>

<ParamField body="optionsProps" type="Omit&lt;CountrySelectOptionsProps, &quot;closeOnSelect&quot; | &quot;searchLabel&quot; | &quot;noResultsLabel&quot; | &quot;searchProps&quot;&gt;">
  Native props, ref, and render for the selection group div rendered by CountrySelect.Options.
</ParamField>

<ParamField body="popupProps" type="Omit&lt;DropdownContentProps, &quot;children&quot;&gt;">
  Dropdown.Content props, including native popup attributes, ref, render, positioning, portal destination, and keepMounted. Explicit popup accessible names override the trigger name. Children are owned by the picker.
</ParamField>

<ParamField body="ref" type="Ref&lt;HTMLButtonElement&gt;">
  Ref to the trigger element.
</ParamField>

<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, PopoverTriggerState&gt;">
  Replaces the trigger element while preserving its behavior and props.
</ParamField>

<ParamField body="searchLabel" type="string">
  Placeholder and accessible name of the search input.
</ParamField>

<ParamField body="searchProps" type="Omit&lt;DropdownSearchProps, &quot;defaultValue&quot; | &quot;value&quot; | &quot;onValueChange&quot;&gt;">
  Native search input props, ref, and render. Search value and change handling are owned by the picker.
</ParamField>

<ParamField body="style" type="CSSProperties | ((state: PopoverTriggerState) =&gt; CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

<ParamField body="value" type="string | null">
  Controlled selected identifier. Null selects no country; undefined leaves selection uncontrolled.
</ParamField>

<ParamField body="wrapperProps" type="Omit&lt;DetailedHTMLProps&lt;HTMLAttributes&lt;HTMLDivElement&gt;, HTMLDivElement&gt;, &quot;children&quot;&gt;">
  Native props and ref for the div around the trigger and its visible label. Children are owned by the picker.
</ParamField>

### CountrySelect.Root

<ParamField body="Root.children" type="ReactNode" required>
  Picker composition containing Dropdown.Root, CountrySelect.Trigger, and CountrySelect.Options. Root adds no DOM element.
</ParamField>

<ParamField body="Root.countries" type="readonly CountryChoice[]" required>
  Prepared country choices with unique stable string values, caller-owned labels, and optional decorative flags and disabled states. An empty string is a valid choice value.
</ParamField>

<ParamField body="Root.defaultValue" type="string | null" default="null">
  Initial uncontrolled selected identifier. Defaults to null.
</ParamField>

<ParamField body="Root.disabled" type="boolean" default="false">
  Prevents opening and selection. An empty country list is also disabled. The trigger stays focusable with aria-disabled.
</ParamField>

<ParamField body="Root.noCountryLabel" type="string" default="No country">
  Text for the null selection and its option. Defaults to No country.
</ParamField>

<ParamField body="Root.onValueChange" type="((value: string | null, eventDetails: DropdownSelectionGroupChangeEventDetails) =&gt; void)">
  Reports the selected identifier or null with event, reason, trigger, cancel and isCanceled details. Call cancel() to preserve selection and keep the popup open.
</ParamField>

<ParamField body="Root.value" type="string | null">
  Controlled selected identifier. Null selects no country; undefined leaves selection uncontrolled.
</ParamField>

### CountrySelect.Trigger

<ParamField body="Trigger.children" type="ReactNode">
  Custom trigger content. Replaces the selected country presentation while retaining shared trigger behavior.
</ParamField>

<ParamField body="Trigger.className" type="string | ((state: PopoverTriggerState) =&gt; string | undefined)">
  Class applied to the trigger button.
</ParamField>

<ParamField body="Trigger.closeDelay" type="number" default="0">
  How long to wait before closing the popover that was opened on hover.
  Specified in milliseconds.

  Requires the `openOnHover` prop.
</ParamField>

<ParamField body="Trigger.delay" type="number" default="300">
  How long to wait before the popover may be opened on hover. Specified in milliseconds.

  Requires the `openOnHover` prop.
</ParamField>

<ParamField body="Trigger.id" type="string">
  ID of the trigger. In addition to being forwarded to the rendered element,
  it is also used to specify the active trigger for the popover in controlled mode (with the PopoverRoot `triggerId` prop).
</ParamField>

<ParamField body="Trigger.label" type="string">
  Optional visible label that names the trigger.
</ParamField>

<ParamField body="Trigger.nativeButton" type="boolean" default="true">
  Whether the component renders a native `<button>` element when replacing it
  via the `render` prop.
  Set to `false` if the rendered element is not a button (e.g. `<div>`).
</ParamField>

<ParamField body="Trigger.openOnHover" type="boolean" default="false">
  Whether the popover should also open when the trigger is hovered.
</ParamField>

<ParamField body="Trigger.ref" type="Ref&lt;HTMLButtonElement&gt;">
  Ref to the trigger element.
</ParamField>

<ParamField body="Trigger.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, PopoverTriggerState&gt;">
  Replaces the trigger element. Custom components must forward the supplied props and ref.
</ParamField>

<ParamField body="Trigger.style" type="CSSProperties | ((state: PopoverTriggerState) =&gt; CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

<ParamField body="Trigger.wrapperProps" type="Omit&lt;DetailedHTMLProps&lt;HTMLAttributes&lt;HTMLDivElement&gt;, HTMLDivElement&gt;, &quot;children&quot;&gt;">
  Native props and ref for the div around the trigger and its visible label. Children are owned by the picker.
</ParamField>

### CountrySelect.Options

<ParamField body="Options.aria-label" type="string">
  Accessible name for the selection listbox. Overrides its default name.
</ParamField>

<ParamField body="Options.aria-labelledby" type="string">
  Accessible name references for the selection listbox. Defaults to the registered Dropdown title or trigger element.
</ParamField>

<ParamField body="Options.className" type="string">
  Class applied to the selection group div.
</ParamField>

<ParamField body="Options.closeOnSelect" type="boolean">
  Closes the popup after a selection. Defaults to true. Cancelled selection keeps it open.
</ParamField>

<ParamField body="Options.noResultsLabel" type="string">
  Text displayed when no choice matches the search. Defaults to No results.
</ParamField>

<ParamField body="Options.ref" type="Ref&lt;HTMLDivElement&gt;">
  Ref to the selection group element.
</ParamField>

<ParamField body="Options.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, CountrySelectOptionsState&gt;">
  Replaces the selection group div. Functions receive supplied props and &#123; value, multiple: false &#125; state, with the public string or null selection. Custom components must forward the supplied props and ref.
</ParamField>

<ParamField body="Options.searchLabel" type="string">
  Search placeholder and accessible name. Defaults to Search.
</ParamField>

<ParamField body="Options.searchProps" type="Omit&lt;DropdownSearchProps, &quot;defaultValue&quot; | &quot;value&quot; | &quot;onValueChange&quot;&gt;">
  Native search input props, ref, and render. Search value and change handling are owned by the picker.
</ParamField>