Data Grid Formatting Panel
Module Extensions
Section titled “Module Extensions”HTMLRevoGridElement (Extended from global)
Section titled “HTMLRevoGridElement (Extended from global)”interface HTMLRevoGridElement { /** Reactive opt-in single-row formatting toolbar configuration. */ dataGridFormattingPanel?: DataGridFormattingPanelSetting; 'data-grid-formatting-panel'?: DataGridFormattingPanelSetting}AdditionalData (Extended from @revolist/revogrid)
Section titled “AdditionalData (Extended from @revolist/revogrid)”interface AdditionalData { /** @deprecated Prefer `grid.dataGridFormattingPanel`. */ dataGridFormattingPanel?: DataGridFormattingPanelSetting}Plugin API
Section titled “Plugin API”resolveDataGridFormattingPanelSelection
Section titled “resolveDataGridFormattingPanelSelection”export function resolveDataGridFormattingPanelSelection<T extends DataType>( revogrid: HTMLRevoGridElement, providers: PluginProviders, headerColumn?: ColumnRegular,): DataGridFormattingResolvedSelection<T> | undefined;selectionFormats
Section titled “selectionFormats”export function selectionFormats<T extends DataType>( formatting: DataGridFormattingPlugin<T>, providers: PluginProviders, selection?: DataGridFormattingResolvedSelection<T>,): (DataGridCellFormat | undefined)[];commonAppearance
Section titled “commonAppearance”export function commonAppearance( formats: readonly (DataGridCellFormat | undefined)[],): FormattingPanelAppearance;commonValueFormat
Section titled “commonValueFormat”export function commonValueFormat( formats: readonly (DataGridCellFormat | undefined)[],): FormattingPanelValueFormat;common
Section titled “common”export function common<T>(values: readonly (T | undefined)[]): MixedValue<T>;numericPreset
Section titled “numericPreset”export function numericPreset(value?: DataGridValueFormatPreset): DataGridValueFormatPreset;stepNumericValueFormat
Section titled “stepNumericValueFormat”export function stepNumericValueFormat( current: DataGridPresetValueFormat | undefined, base: DataGridPresetValueFormat, direction: -1 | 1,): DataGridPresetValueFormat;MixedValue
Section titled “MixedValue”export type MixedValue<T> = T | 'mixed' | undefined;FormattingPanelValueCategory
Section titled “FormattingPanelValueCategory”export type FormattingPanelValueCategory = DataGridValueFormatPreset | 'advanced';FormattingPanelValueFormat
Section titled “FormattingPanelValueFormat”interface FormattingPanelValueFormat { readonly category: MixedValue<FormattingPanelValueCategory>; readonly presentationId?: string}FormattingPanelAppearance
Section titled “FormattingPanelAppearance”interface FormattingPanelAppearance { readonly fontFamily: MixedValue<DataGridCellAppearance['fontFamily']>; readonly fontSize: MixedValue<DataGridCellAppearance['fontSize']>; readonly bold: MixedValue<DataGridCellAppearance['bold']>; readonly italic: MixedValue<DataGridCellAppearance['italic']>; readonly underline: MixedValue<DataGridCellAppearance['underline']>; readonly strike: MixedValue<DataGridCellAppearance['strike']>; readonly textColor: MixedValue<DataGridCellAppearance['textColor']>; readonly fillColor: MixedValue<DataGridCellAppearance['fillColor']>; readonly horizontal: MixedValue<DataGridCellAppearance['horizontal']>; readonly vertical: MixedValue<DataGridCellAppearance['vertical']>; readonly wrap: MixedValue<DataGridCellAppearance['wrap']>; readonly borderStyle: MixedValue<DataGridCellAppearance['borderStyle']>; readonly borderColor: MixedValue<DataGridCellAppearance['borderColor']>}DataGridFormattingPanel
Section titled “DataGridFormattingPanel”export function DataGridFormattingPanel<T extends DataType>({ formatting, selection, target, providers, panelLocale, buttons,}: DataGridFormattingPanelProps<T>);resolveDataGridFormattingPanelLocale
Section titled “resolveDataGridFormattingPanelLocale”export function resolveDataGridFormattingPanelLocale( value?: Partial<DataGridFormattingPanelLocaleText>,): DataGridFormattingPanelLocaleText;DataGridFormattingPanelLocaleText
Section titled “DataGridFormattingPanelLocaleText”interface DataGridFormattingPanelLocaleText { readonly toolbar: string; readonly mixed: string; readonly more: string; readonly decreaseDecimals: string; readonly increaseDecimals: string; readonly formatCells: string}DataGridFormattingPanelButtonContext
Section titled “DataGridFormattingPanelButtonContext”Runtime state supplied to an application-owned formatting-panel button.
interface DataGridFormattingPanelButtonContext { readonly formatting: DataGridFormattingPlugin<T>; readonly providers: PluginProviders; readonly selection?: DataGridFormattingResolvedSelection<T>; readonly target?: DataGridFormattingTarget; /** True when the panel has no writable formatting target. */ readonly disabled: boolean; /** Definition resolved from `presentationId`, when one is registered. */ readonly presentation?: DataGridAdvancedFormatDefinition}DataGridFormattingPanelButtonState
Section titled “DataGridFormattingPanelButtonState”export type DataGridFormattingPanelButtonState<T extends DataType, TValue> = | TValue | ((context: DataGridFormattingPanelButtonContext<T>) => TValue);DataGridFormattingPanelButton
Section titled “DataGridFormattingPanelButton”Application-owned action or registered-format shortcut shown in the toolbar.
interface DataGridFormattingPanelButton { /** Stable key used for rendering and application styling hooks. */ readonly id: string; /** Accessible label. Falls back to the registered presentation label, then `id`. */ readonly label?: string; /** Trusted raw SVG markup. Falls back to the registered presentation icon. */ readonly icon?: string; /** Optional caption rendered beside the icon. */ readonly visibleLabel?: string; readonly className?: string; /** Registered advanced-format shortcut applied when `onClick` is omitted. */ readonly presentationId?: string; readonly presentationOptions?: Readonly<Record<string, unknown>>; /** Defaults to the panel's selection-disabled state. */ readonly disabled?: DataGridFormattingPanelButtonState<T, boolean>; /** Presentation shortcuts infer pressed state from the active format. */ readonly pressed?: DataGridFormattingPanelButtonState<T, boolean | 'mixed'>; /** Custom action. When supplied, it takes precedence over `presentationId`. */ readonly onClick?: (context: DataGridFormattingPanelButtonContext<T>) => void}DataGridFormattingPanelConfig
Section titled “DataGridFormattingPanelConfig”interface DataGridFormattingPanelConfig { readonly localeText?: Partial<DataGridFormattingPanelLocaleText>; /** * Application toolbar actions. Fonts and advanced-format definitions are * inherited from the shared `DataGridFormattingPlugin` configuration. */ readonly buttons?: readonly DataGridFormattingPanelButton<T>[]}DataGridFormattingPanelSetting
Section titled “DataGridFormattingPanelSetting”Reactive formatting-panel setting. Omitted and false are disabled.
/** Reactive formatting-panel setting. Omitted and `false` are disabled. */export type DataGridFormattingPanelSetting<T extends DataType = DataType> = | boolean | DataGridFormattingPanelConfig<T>;DATA_GRID_FORMATTING_PANEL_LOCALE
Section titled “DATA_GRID_FORMATTING_PANEL_LOCALE”DATA_GRID_FORMATTING_PANEL_LOCALE: { toolbar: string; mixed: string; more: string; decreaseDecimals: string; increaseDecimals: string; formatCells: string;};DataGridFormattingPanelPlugin
Section titled “DataGridFormattingPanelPlugin”One-line spreadsheet formatting toolbar for the active RevoGrid selection.
Its runtime is installed with DataGridFormattingPlugin, but the toolbar is
disabled until grid.dataGridFormattingPanel is set to true or a config.
Fonts and advanced formats come from the shared formatting configuration;
application buttons can run callbacks or reference a registered presentation.
Example: Custom format shortcut using shared label and icon metadata
grid.dataGridContextMenu = { formatting: { fontFamilies: ['Inter', 'IBM Plex Mono'], advancedFormats: { customFormats: [riskFormat] },} };grid.dataGridFormattingPanel = { buttons: [{ id: 'risk', presentationId: riskFormat.id }],};Dependencies
Section titled “Dependencies”- Auto-installed
DataGridFormattingPlugin: Applies toolbar commands through DataGridFormattingPlugin. - Event integration
focuscell,setrange,headerclick: Tracks active cell ranges and whole-column header selections.
class DataGridFormattingPanelPlugin {}AppearanceControls
Section titled “AppearanceControls”export function AppearanceControls({ appearance, locale, disabled, onAppearance }: { readonly appearance: FormattingPanelAppearance; readonly locale: DataGridFormattingLocaleText; readonly disabled: boolean; readonly onAppearance: (patch: Partial<DataGridCellAppearance>) => void;});horizontalOptions
Section titled “horizontalOptions”export function horizontalOptions(locale: DataGridFormattingLocaleText);verticalOptions
Section titled “verticalOptions”export function verticalOptions(locale: DataGridFormattingLocaleText);borderOptions
Section titled “borderOptions”export function borderOptions(locale: DataGridFormattingLocaleText);Divider
Section titled “Divider”export function Divider({ className = '' }: { readonly className?: string });IconButton
Section titled “IconButton”export function IconButton({ label, icon, visibleLabel, className = '', disabled, pressed, expanded, onClick,}: IconButtonProps);TextIconButton
Section titled “TextIconButton”export function TextIconButton({ label, text, icon, disabled, onClick }: { readonly label: string; readonly text: string; readonly icon: string; readonly disabled?: boolean; readonly onClick: () => void;});ToggleButton
Section titled “ToggleButton”export function ToggleButton({ value, onChange, ...props }: Omit<IconButtonProps, 'pressed' | 'onClick'> & { readonly value: MixedValue<boolean>; readonly onChange: (value: boolean) => void;});IconSelect
Section titled “IconSelect”export function IconSelect({ label, value, options, icon, disabled, className = '', onChange }: { readonly label: string; readonly value: MixedValue<string>; readonly options: readonly (readonly string[])[]; readonly icon: string; readonly disabled?: boolean; readonly className?: string; readonly onChange: (value: string) => void;});CompactColorPicker
Section titled “CompactColorPicker”export function CompactColorPicker({ label, icon, value, locale, disabled, onChange }: { readonly label: string; readonly icon: string; readonly value: MixedValue<string>; readonly locale: DataGridFormattingLocaleText; readonly disabled?: boolean; readonly onChange: (value: string | undefined) => void;});horizontalIcon
Section titled “horizontalIcon”export function horizontalIcon(value: MixedValue<DataGridCellAppearance['horizontal']>): string;verticalIcon
Section titled “verticalIcon”export function verticalIcon(value: MixedValue<DataGridCellAppearance['vertical']>): string;IconButtonProps
Section titled “IconButtonProps”interface IconButtonProps { readonly label: string; readonly icon: string; readonly visibleLabel?: string; readonly className?: string; readonly disabled?: boolean; readonly pressed?: boolean | 'mixed'; readonly expanded?: boolean; readonly onClick: () => void}CustomFormattingButtons
Section titled “CustomFormattingButtons”export function CustomFormattingButtons<T extends DataType>({ buttons, formatting, selection, target, providers, disabled, activePresentationId,}: { readonly buttons: readonly DataGridFormattingPanelButton<T>[]; readonly formatting: DataGridFormattingPlugin<T>; readonly selection?: DataGridFormattingResolvedSelection<T>; readonly target?: DataGridFormattingTarget; readonly providers: PluginProviders; readonly disabled: boolean; readonly activePresentationId?: string;});FormattingPanelOverflow
Section titled “FormattingPanelOverflow”export function FormattingPanelOverflow({ appearance, locale, panelLocale, fonts, disabled, onAppearance, onFormatCells,}: { readonly appearance: FormattingPanelAppearance; readonly locale: DataGridFormattingLocaleText; readonly panelLocale: DataGridFormattingPanelLocaleText; readonly fonts: readonly string[]; readonly disabled: boolean; readonly onAppearance: (patch: Partial<DataGridCellAppearance>) => void; readonly onFormatCells: () => void;});TypographyControls
Section titled “TypographyControls”export function TypographyControls({ appearance, locale, panelLocale, fonts, disabled, onAppearance,}: { readonly appearance: FormattingPanelAppearance; readonly locale: DataGridFormattingLocaleText; readonly panelLocale: DataGridFormattingPanelLocaleText; readonly fonts: readonly string[]; readonly disabled: boolean; readonly onAppearance: (patch: Partial<DataGridCellAppearance>) => void;});FontFamilyOptions
Section titled “FontFamilyOptions”export function FontFamilyOptions({ value, fonts, defaultLabel, mixedLabel }: { readonly value: FormattingPanelAppearance['fontFamily']; readonly fonts: readonly string[]; readonly defaultLabel: string; readonly mixedLabel: string;});FontSizeInput
Section titled “FontSizeInput”export function FontSizeInput({ value, disabled, onChange }: { readonly value: FormattingPanelAppearance['fontSize']; readonly disabled: boolean; readonly onChange: (value: number | undefined) => void;});ValueFormatControls
Section titled “ValueFormatControls”export function ValueFormatControls({ category, advancedLabel, valueKind, locale, panelLocale, disabled, canFormatValue, onPreset, onAdjustDecimals,}: { readonly category: MixedValue<FormattingPanelValueCategory>; readonly advancedLabel: string; readonly valueKind: DataGridFormattingValueKind; readonly locale: DataGridFormattingLocaleText; readonly panelLocale: DataGridFormattingPanelLocaleText; readonly disabled: boolean; readonly canFormatValue: boolean; readonly onPreset: (preset: DataGridValueFormatPreset) => void; readonly onAdjustDecimals: (direction: -1 | 1) => void;});