Matrix questions (also known as grid questions or Likert tables) allow respondents to rate multiple items using the same scale. They're essential for professional surveys, employee feedback, product evaluations, and any scenario where you need structured, comparable ratings across multiple aspects.
Every code snippet below is fully editable! Feel free to modify the code, experiment with different values, and see your changes reflected instantly in the live preview on the right.
Use the play button to run different snippet, or the refresh button to restore the original example.
Let's start with a simple matrix question. Define rows for the items to rate and columns for the rating options. By default, users can select one option per row (single selection mode).
Use selectionMode: 'multiple' to allow selecting multiple columns per row. This is useful for "select all that apply" scenarios where options aren't mutually exclusive.
Add isRequired: true to individual rows that must be answered. Required rows show an asterisk (*) and unanswered ones are highlighted on submit.
Control whether users can deselect their choice on a per-row basis using allowDeselect. By default, clicking the same selection again will clear it.
allowDeselect: false on rows where the selection must be permanent once made. This is useful for critical questions where you want to ensure a definitive answer. Rows without this property default to allowing deselection. Create a classic Likert scale matrix for measuring agreement levels. The 5-point scale from "Strongly Disagree" to "Strongly Agree" is the most common format.
The striped option (enabled by default) adds alternating background colors to rows for better readability. Set it to false for a cleaner look.
Add optional description to rows to provide additional context or clarification for each item being rated.
Control the matrix width with fullWidth (default: true) and horizontal positioning with alignment. Set fullWidth: false to let the matrix size based on content.
fullWidth is false, the matrix will only be as wide as needed. Combined with alignment, you can center or right-align compact matrices for a more balanced layout. Use isReadOnly: true combined with computedValue to create a summary matrix that displays data from other form fields. Great for review screens!
Use isVisible to show different matrix questions based on user responses. This creates personalized survey experiences.
Let's put it all together! This comprehensive example demonstrates a real-world employee feedback survey using multiple matrix questions organized into sections.
| Property | Type | Default | Description |
|---|---|---|---|
rows | {id, label, description?, isRequired?, allowDeselect?}[] | Required | Items/aspects to rate |
columns | {id, label}[] | Required | Rating scale options |
selectionMode | 'single' | 'multiple' | 'single' | One or many per row |
striped | boolean | true | Alternating row colors |
alignment | 'left' | 'center' | 'right' | 'left' | Horizontal alignment |
fullWidth | boolean | true | Stretch to container width |
You've mastered matrix questions for structured feedback surveys. Ready to explore more form components?
Continue to Rating Scale TutorialOther learning paths: