# Sheets

Developers can define any `Sheet` type, as CanvasGrid is agnostic of sheets. The sheet model used by `useSpreadsheetState` hook is

<https://github.com/rowsncolumns/spreadsheet/blob/main/apps/spreadsheet/types.ts#L6>

```typescript
export type Sheet = {
  title: string;
  sheetId: number;
  tabColor?: string;
  hidden?: boolean;
  rowCount?: number;
  columnCount?: number;
  frozenRowCount?: number;
  frozenColumnCount?: number;
  hideGridlines?: boolean;
  merges?: GridRange[];
  basicFilter?: FilterView;
  rowMetadata?: (DimensionProperties | null)[];
  columnMetadata?: (DimensionProperties | null)[];
};
```

## Sheet components

The following Sheet components are packaged with Spreadsheet

* NewSheetButton
* SheetSwitcher
* SheetTabs
* SheetStatus
* TableEditor
* DeleteSheetConfirmation

## Using your own Sheet type

You can extend from the core `Sheet` type and add your custom attributes

```typescript
import { SpreadsheetProvider, CanvasGrid, Sheet } from "@rowsncolumns/spreadsheet";
import { useSpreadsheetState } from "@rowsncolumns/spreadsheet-state"

type MyCustomSheet = Sheet & {
  owner: string;
  module: string
}

const Spreadsheet = () => {
  const [ sheets, onChangeSheets ] = useState<MyCustomSheet[]>([])
  const { } = useSpreadsheetState({
    sheets,
    onChangeSheets
  })
  return (
    <CanvasGrid
      rowCount={1000}
      columnCount={1000}
      sheetId={1}
    />
  );
};

export const App = () => (
  <SpreadsheetProvider>
    <Spreadsheet />
  <SpreadsheetProvider />
)
```


---

# 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/api/sheets.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.
