Skip to content

The open alternative to Salesforce, designed for AI.

10.1 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="aria-label" type="string" required>
  Required accessible name for the country selector trigger.
</ParamField>

<ParamField body="children" type="ReactNode">
  Optional trigger content replacing the default country flag or world icon and chevron.
</ParamField>

<ParamField body="className" type="string | ((state: PopoverTriggerState) =&gt; string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</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 dropdown after an accepted selection. Defaults to true.
</ParamField>

<ParamField body="contentProps" type="Omit&lt;DropdownContentProps, &quot;children&quot;&gt;">
  Props for the internally assembled Dropdown.Content, including its accessible name, placement, width and popup ref.
</ParamField>

<ParamField body="countries" type="readonly PhoneCountryOption[]" required>
  Prepared choices with a unique stable value, localized label, digits-only calling code without a plus sign, decorative flag node and optional disabled state. Matching choices retain their supplied order after the selected country.
</ParamField>

<ParamField body="defaultValue" type="string | null">
  Initial uncontrolled country identifier. Omit it or use null to start empty.
</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">
  Disables the trigger, search and country selection.
</ParamField>

<ParamField body="dropdownProps" type="Omit&lt;DropdownRootProps, &quot;children&quot; | &quot;type&quot; | &quot;multiple&quot;&gt;">
  Props for the internally assembled Dropdown.Root, including controlled open state and open-change events. The picker fixes its type to picker.
</ParamField>

<ParamField body="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="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="onValueChange" type="((value: string | null, eventDetails: DropdownSelectionGroupChangeEventDetails) =&gt; void)">
  Receives the requested country identifier or null and Dropdown.SelectionGroup event details, including reason, event, trigger and cancel(). Cancel before updating controlled state to reject a selection.
</ParamField>

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

<ParamField body="optionsProps" type="PhoneCountryPickerOptionsProps">
  Props for the options root div, including native attributes, ref, render, searchLabel, listLabel and emptyLabel. Search matches normalized labels and identifiers, or calling codes with an optional leading plus sign. Surrounding query whitespace is trimmed.
</ParamField>

<ParamField body="ref" type="Ref&lt;HTMLButtonElement&gt;">
  Ref to the trigger button, or the element composed through render.
</ParamField>

<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, PopoverTriggerState&gt;">
  Composes the trigger with an element or render callback. Native attributes, handlers, className, style and ref target the trigger.
</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 country identifier. Use null to clear the selection. Labels and calling codes do not replace this value.
</ParamField>

### PhoneCountryPicker.Root

<ParamField body="Root.children" type="ReactNode" required>
  A Dropdown.Root with type="picker", its Trigger, Content and Options. Root shares prepared data and selection and renders no DOM node.
</ParamField>

<ParamField body="Root.closeOnSelect" type="boolean" default="true">
  Closes the composed Dropdown after an accepted selection. Defaults to true.
</ParamField>

<ParamField body="Root.countries" type="readonly PhoneCountryOption[]" required>
  Prepared choices shared by Trigger and Options, with unique stable values, localized labels, digits-only calling codes without a plus sign, decorative flag nodes and optional disabled states.
</ParamField>

<ParamField body="Root.defaultValue" type="string | null" default="null">
  Initial uncontrolled country identifier. Omit it or use null to start empty.
</ParamField>

<ParamField body="Root.disabled" type="boolean" default="false">
  Disables the composed trigger, search and country selection.
</ParamField>

<ParamField body="Root.onValueChange" type="((value: string | null, eventDetails: DropdownSelectionGroupChangeEventDetails) =&gt; void)">
  Receives the requested identifier or null and Dropdown.SelectionGroup event details, including reason, event, trigger and cancel(). Cancel before updating controlled state to reject a selection.
</ParamField>

<ParamField body="Root.value" type="string | null">
  Controlled country identifier shared by the parts. Use null to clear the selection.
</ParamField>

### PhoneCountryPicker.Trigger

<ParamField body="Trigger.aria-label" type="string" required>
  Required accessible name for the country selector button.
</ParamField>

<ParamField body="Trigger.children" type="ReactNode">
  Optional trigger content replacing the selected country flag or empty world icon and chevron. The selected label comes from Root.
</ParamField>

<ParamField body="Trigger.className" type="string | ((state: PopoverTriggerState) =&gt; string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</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.disabled" type="boolean">
  Disables the native trigger button in addition to Root.disabled.
</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.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 button, or the element composed through render.
</ParamField>

<ParamField body="Trigger.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, PopoverTriggerState&gt;">
  Composes the Dropdown trigger with an element or render callback. Native attributes, handlers, className, style and ref target this element.
</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>

### PhoneCountryPicker.Options

<ParamField body="Options.disabled" type="boolean">
  Disables search and selection in addition to Root.disabled.
</ParamField>

<ParamField body="Options.emptyLabel" type="string" default="No results">
  Status message shown when no country label, identifier or calling code matches. Defaults to No results.
</ParamField>

<ParamField body="Options.listLabel" type="string" default="Countries">
  Accessible name of the country listbox, separate from the search field. Defaults to Countries.
</ParamField>

<ParamField body="Options.ref" type="Ref&lt;HTMLDivElement&gt;">
  Ref to the options root div, or the element composed through render.
</ParamField>

<ParamField body="Options.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, {}&gt;">
  Composes the non-interactive options root with an element or render callback. Native attributes, handlers, className, style and ref target this element. searchLabel names the internal search input.
</ParamField>

<ParamField body="Options.searchLabel" type="string" default="Search">
  Accessible name and placeholder of the country search field. Defaults to Search. Search matches normalized labels and identifiers, or calling codes with an optional leading plus sign. Surrounding query whitespace is trimmed.
</ParamField>