# Cell Format Editor

<figure><img src="/files/WaYgvq8tpXUID1J82VSC" alt=""><figcaption><p>Cmd + Option + 1 will bring up the cell format editor</p></figcaption></figure>

<pre class="language-tsx" data-overflow="wrap"><code class="lang-tsx">import { CanvasGrid, defaultSpreadsheetTheme } from "@rowsncolumns/spreadsheet"
import { useSpreadsheetState, CellFormatEditor, CellFormatEditorDialog } from "@rowsncolumns/spreadsheet-state"

const App = () => {
  const activeSheetId = 1
  const [theme, onChangeTheme] = useState&#x3C;SpreadsheetTheme>(
    defaultSpreadsheetTheme
  );
<strong>  const {
</strong><strong>    activeCell,
</strong><strong>    selections,
</strong><strong>    theme,
</strong><strong>    onMergeCells,
</strong><strong>    onChangeFormatting,
</strong><strong>    onChangeBorder,
</strong><strong>    onRequestFormatCells,
</strong><strong>    getUserEnteredFormat,
</strong><strong>    getEffectiveValue
</strong><strong>  } = useSpreadsheetState({
</strong>    ...
  })
  
  const currentCellFormat = useMemo(
    () =>
      getUserEnteredFormat(
        activeSheetId,
        activeCell.rowIndex,
        activeCell.columnIndex
      ),
    [activeSheetId, activeCell, getUserEnteredFormat]
  );
  return (
    &#x3C;>
      &#x3C;CanvasGrid
        // Binds to keyboard shortcut and context menu
        onRequestFormatCells={onRequestFormatCells}
      />
      &#x3C;CellFormatEditorDialog>
        &#x3C;CellFormatEditor
          sheetId={activeSheetId}
          activeCell={activeCell}
          selections={selections}
          onChangeFormatting={onChangeFormatting}
          cellFormat={currentCellFormat}
          getEffectiveValue={getEffectiveValue}
          onMergeCells={onMergeCells}
          theme={theme}
          onChangeBorder={onChangeBorder}
        />
      &#x3C;/CellFormatEditorDialog>

    &#x3C;/>
  )
}
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rowsncolumns.app/configuration/components/cell-format-editor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
