Home / Function/ ComboboxRtl() — ui Function Reference

ComboboxRtl() — ui Function Reference

Architecture documentation for the ComboboxRtl() function in combobox-rtl.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  85681c9b_d862_40aa_7c89_5558914ab4b4["ComboboxRtl()"]
  f9bf9085_ef1d_4a76_ef75_ad8f7e0ef601["combobox-rtl.tsx"]
  85681c9b_d862_40aa_7c89_5558914ab4b4 -->|defined in| f9bf9085_ef1d_4a76_ef75_ad8f7e0ef601
  style 85681c9b_d862_40aa_7c89_5558914ab4b4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/combobox-rtl.tsx lines 77–133

export function ComboboxRtl() {
  const { dir, t, language } = useTranslation(translations, "ar")
  const anchor = useComboboxAnchor()

  const categoryLabels: Record<string, string> = {
    technology: t.technology,
    design: t.design,
    business: t.business,
    marketing: t.marketing,
    education: t.education,
    health: t.health,
  }

  return (
    <Field className="mx-auto w-full max-w-xs">
      <FieldLabel>{t.label}</FieldLabel>
      <Combobox
        multiple
        autoHighlight
        items={categories}
        defaultValue={[categories[0]]}
        itemToStringValue={(item: (typeof categories)[number]) =>
          categoryLabels[item] || item
        }
      >
        <ComboboxChips ref={anchor}>
          <ComboboxValue>
            {(values) => (
              <React.Fragment>
                {values.map((value: string) => (
                  <ComboboxChip key={value}>
                    {categoryLabels[value] || value}
                  </ComboboxChip>
                ))}
                <ComboboxChipsInput placeholder={t.placeholder} />
              </React.Fragment>
            )}
          </ComboboxValue>
        </ComboboxChips>
        <ComboboxContent
          anchor={anchor}
          dir={dir}
          data-lang={dir === "rtl" ? language : undefined}
        >
          <ComboboxEmpty>{t.empty}</ComboboxEmpty>
          <ComboboxList>
            {(item) => (
              <ComboboxItem key={item} value={item}>
                {categoryLabels[item] || item}
              </ComboboxItem>
            )}
          </ComboboxList>
        </ComboboxContent>
      </Combobox>
    </Field>
  )
}

Subdomains

Frequently Asked Questions

What does ComboboxRtl() do?
ComboboxRtl() is a function in the ui codebase, defined in apps/v4/examples/base/combobox-rtl.tsx.
Where is ComboboxRtl() defined?
ComboboxRtl() is defined in apps/v4/examples/base/combobox-rtl.tsx at line 77.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free