Typix LogoTypix
Editor Toolbar

FontFamilyDropdownMenu

Select a font family from a configurable list.

Install

npx typix ui add font-family-dropdown-menu

Import

import {
  FontFamilyDropdownMenu,
  type FontFamilyItem,
} from "@/components/typix/main/font-family-dropdown-menu";

Props

PropTypeDefaultDescription
familiesFontFamilyItem[]List of font families to show. Required.
hideWhenUnavailablebooleanfalseHide when font family can't be changed.
portalbooleantrueRender dropdown in a portal.
classNamestringAdditional CSS classes.

FontFamilyItem

interface FontFamilyItem {
  label: string;  // Display name, e.g. "Sans Serif"
  value: string;  // CSS font-family value, e.g. "sans-serif"
}

Example

const FONT_FAMILIES: FontFamilyItem[] = [
  { label: "Sans Serif", value: "sans-serif" },
  { label: "Serif", value: "serif" },
  { label: "Monospace", value: "monospace" },
  { label: "Inter", value: "'Inter', sans-serif" },
];

<FontFamilyDropdownMenu families={FONT_FAMILIES} />

On this page