# Rating

Ratings are used to collect measurable feedback from users.

![MonalisaUI](https://raw.githubusercontent.com/tuantvk/monalisa-ui/master/assets/monalisaui-rating.png)

View full example: [Rating Example](https://github.com/tuantvk/monalisa-ui/blob/master/example/Rating/index.js)

```javascript
import React from 'react';
import { View } from 'react-native';
import { Rating } from 'monalisa-ui';

const Example = () => (
  <View>
    <Rating />
  </View>
);

export default Example;
```

## Configuration

| Property              |                     Default                    |  Option  |                Description               |
| --------------------- | :--------------------------------------------: | :------: | :--------------------------------------: |
| reviews               | \['Bad', 'Okay', 'Good', 'Great', 'Very Good'] |   array  | Labels to show when each value is tapped |
| size                  |                       30                       |  number  |                 Size star                |
| style                 |                        -                       |     -    |           Style for the rating           |
| ratingColor           |                     #979797                    |  string  |         Color for the rating icon        |
| ratingBackgroundColor |                     #f1c40f                    |  string  |   Background color for the rating icon   |
| titleStyle            |                        -                       |     -    |            Style for the title           |
| iconStyle             |                        -                       |     -    |            Style for the icon            |
| showTitle             |                      true                      |  boolean |           Toggle display title           |
| defaultRating         |                      none                      |  number  |       Initial value for the rating       |
| onChange              |                        -                       | function |            Return value review           |

## Example

* rating custom

```javascript
import React from 'react';
import { View } from 'react-native';
import { Rating } from 'monalisa-ui';

const Example = () => (
  <View>
    <Rating
      defaultRating={1}
    />
    <Rating
      defaultRating={4}
      ratingBackgroundColor="#ff0000"
    />
    <Rating
      showTitle={false}
      defaultRating={4}
    />
  </View>
);

export default Example;
```


---

# 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://tuantvk.gitbook.io/monalisaui/rating.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.
