# tableberg/1.2.0/components/editor/TypographyPanelItem.tsx

Tableberg – Simple Gutenberg Table Block, version 1.2.0. 64 lines.

- Page: https://pluginprobe.com/plugins/tableberg/1.2.0/code/components/editor/TypographyPanelItem.tsx
- Raw: https://pluginprobe.com/plugins/tableberg/1.2.0/raw/components/editor/TypographyPanelItem.tsx
- Modified: 2026-09-30T16:56:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tableberg/1.2.0/code/components/editor/TypographyPanelItem.tsx#L10-L20`.

```tsx
import { ReactNode } from "react";
import { useBlockEditContext } from "@wordpress/block-editor";
import { __experimentalToolsPanelItem as ToolsPanelItem } from "@wordpress/components";

/**
 * What every typography control below takes. The value is the plain CSS value
 * the control edits, so a block can keep it wherever its attributes live.
 */
export interface TypographyControlProps {
    label?: string;
    value: string;
    onChange: (newValue: string) => void;
    /** Defaults to clearing the value. */
    onDeselect?: () => void;
    resetAllFilter?: () => void;
    isShownByDefault?: boolean;
    /** Half width, so two controls sit side by side. */
    isSingleColumn?: boolean;
    /** Defaults to the block being edited. */
    panelId?: string;
}

interface Props {
    label: string;
    hasValue: () => boolean;
    onDeselect: () => void;
    resetAllFilter?: () => void;
    isShownByDefault?: boolean;
    isSingleColumn?: boolean;
    panelId?: string;
    children: ReactNode;
}

/**
 * The ToolsPanel plumbing the typography controls share: the menu entry, its
 * reset and the two-column layout.
 */
export default function TypographyPanelItem({
    label,
    hasValue,
    onDeselect,
    resetAllFilter,
    isShownByDefault = false,
    isSingleColumn = false,
    panelId,
    children,
}: Props) {
    const { clientId } = useBlockEditContext();

    return (
        <ToolsPanelItem
            panelId={panelId ?? clientId}
            className={isSingleColumn ? "single-column" : undefined}
            label={label}
            hasValue={hasValue}
            onDeselect={onDeselect}
            resetAllFilter={resetAllFilter ?? onDeselect}
            isShownByDefault={isShownByDefault}
        >
            {children}
        </ToolsPanelItem>
    );
}

```
