---
title: Matrix Question with Custom Cell Types
product: Survey Creator
description: With SurveyJS, you can create matrix table questions with custom cell types to make survey taking even more convenient for your respondents. View a free demo example for JavaScript to learn more.
framework: React
source: https://surveyjs.io/survey-creator/examples/matrix-table-question-with-custom-cell-types/reactjs
index: https://surveyjs.io/survey-creator/examples/overview.md
---

# Matrix Question with Custom Cell Types (React)

Multi-Select and Dynamic Matrix question types provide built-in support for a number of cell editors, such as drop-down menus, radio button groups, text input fields, etc. If the built-in functionality doesn't suit your use case, you can extend the collection of available cell editors by implementing a custom editor or by using other editors from [SurveyJS Form Library](https://surveyjs.io/form-library/documentation/overview), as demonstrated in this example.

By default, Multi-Select Matrix and Dynamic Matrix columns support the cell editors listed in the [`cellType`](https://surveyjs.io/form-library/documentation/api-reference/multi-select-matrix-column-values#cellType) property description. These cell editors are based upon standalone question types from SurveyJS Form Library. However, the library also includes other question types. To use them as matrix cell editors, add a property named as the question type to the [`matrixDropdownColumnTypes`](https://github.com/surveyjs/survey-library/blob/241175c388587c36aed2c33a68b25f0a87cf663b/src/question_matrixdropdowncolumn.ts#L63) object and assign an empty object to this property. This demo and the following code shows how to add the [File Upload](https://surveyjs.io/form-library/documentation/api-reference/file-model) question type to the list of supported cell editors:

```js
import { matrixDropdownColumnTypes } from "survey-core";

matrixDropdownColumnTypes["file"] = {};
```

Now, users can select File Upload from the **Cell input type** drop-down menu when they click a matrix column. File Upload properties also become available for configuration in the Property Grid.

## Files

### `public/index.html`

```html
<!-- Uncomment the following lines to enable Ace Editor in the JSON Editor tab -->
<!-- 
<script src="https://unpkg.com/ace-builds/src-min-noconflict/ace.js"></script>
<script src="https://unpkg.com/ace-builds/src-min-noconflict/ext-searchbox.js"></script>
<script src="https://unpkg.com/ace-builds/src-min-noconflict/theme-clouds_midnight.js"></script>
-->

<div id="surveyCreatorContainer" style="position: absolute; height: 100%; width: 100%"></div>
```

### `src/survey_json.js`

```js
export const surveyJson = {
  "elements": [
    {
      "name": "first-name",
      "title": "First name:",
      "type": "text",
      "titleLocation": "left",
      "isRequired": true
    },
    {
      "name": "last-name",
      "title": "Last name:",
      "type": "text",
      "isRequired": true,
      "titleLocation": "left",
      "startWithNewLine": false
    },
    {
      "name": "email",
      "title": "E-mail:",
      "type": "text",
      "inputType": "email",
      "isRequired": true,
      "titleLocation": "left",
      "startWithNewLine": false
    },
    {
      "type": "matrixdynamic",
      "name": "assignments",
      "title": "Submit your assignments",
      "addRowText": "Add a subject",
      "columns": [
        {
          "name": "subjects",
          "title": "Select a subject",
          "cellType": "dropdown",
          "isRequired": true,
          "choices": [ "English: American Literature", "English: British and World Literature", "Math: Consumer Math", "Math: Practical Math", "Math: Developmental Algebra", "Math: Continuing Algebra", "Math: Pre-Algebra", "Math: Algebra", "Math: Geometry", "Math: Integrated Mathematics", "Science: Physical Science", "Science: Earth Science", "Science: Biology", "Science: Chemistry", "History: World History", "History: Modern World Studies", "History: U.S. History", "History: Modern U.S. History", "Social Sciences: U.S. Government and Politics", "Social Sciences: U.S. and Global Economics", "World Languages: Spanish", "World Languages: French", "World Languages: German", "World Languages: Latin", "World Languages: Chinese", "World Languages: Japanese" ]
        },
        {
          "name": "assignment-scans",
          "title": "Upload your assignment",
          "cellType": "file",
          "isRequired": true,
          "allowMultiple": true
        },
        {
          "name": "notes",
          "title": "Additional comments",
          "cellType": "comment"
        }
      ],
      "rowCount": 1
    }
  ],
  "completeText": "Submit"
};
```

### `src/SurveyCreatorComponent.jsx`

```js
import React from "react";
import { SurveyCreator, SurveyCreatorComponent } from "survey-creator-react";
import "survey-core/survey.i18n";
import "survey-creator-core/survey-creator-core.i18n";
import { matrixDropdownColumnTypes } from "survey-core";
import { surveyJson } from "./survey_json";
import "survey-core/survey-core.css";
import "survey-creator-core/survey-creator-core.css";
import "./index.css";

import SurveyTheme from "survey-core/themes";
import { registerCreatorTheme } from "survey-creator-core";

registerCreatorTheme(SurveyTheme); // Add predefined Survey Creator UI themes

// Enable the File Upload type for use in matrix columns
matrixDropdownColumnTypes["file"] = {};

function SurveyCreatorRenderComponent() {
    const creator = new SurveyCreator();
    creator.JSON = surveyJson;
    return (<SurveyCreatorComponent creator={creator} />);
}

export default SurveyCreatorRenderComponent;
```

### `src/index.css`

```css
/* You can add your custom CSS here. */
```

### `src/index.js`

```js
import React from "react";
import { createRoot } from "react-dom/client";
import SurveyCreatorRenderComponent from "./SurveyCreatorComponent";

const root = createRoot(document.getElementById("surveyCreatorContainer"));
root.render(<SurveyCreatorRenderComponent />);
```

### `package.json`

```json
{
  "dependencies": {
    "react": "latest",
    "react-dom": "latest",
    "survey-core": "latest",
    "survey-react-ui": "latest",
    "survey-creator-core": "latest",
    "survey-creator-react": "latest"
  },
  "devDependencies": {
    "react-scripts": "latest"
  }
}
```

## Other Frameworks

- [Angular](https://surveyjs.io/survey-creator/examples/matrix-table-question-with-custom-cell-types/angular.md)
- [Vue 3](https://surveyjs.io/survey-creator/examples/matrix-table-question-with-custom-cell-types/vue3js.md)
- [jQuery](https://surveyjs.io/survey-creator/examples/matrix-table-question-with-custom-cell-types/jquery.md)
- [Vanilla JS](https://surveyjs.io/survey-creator/examples/matrix-table-question-with-custom-cell-types/vanillajs.md)
