@aliretail/react-materials-components
Version:
46 lines (42 loc) • 868 B
Markdown
title: Rating
order: 130
```jsx
import React from 'react';
import ReactDOM from 'react-dom';
import { FormComponents } from '@aliretail/react-materials-components';
const { Rating, SchemaForm, SchemaMarkupField: Field, createFormActions } = FormComponents;
const App = () => {
return (
<SchemaForm
components={{
Rating,
}}
onChange={console.log}
defaultValue={{
readOnly: 3,
}}
>
<Field
x-component="Rating"
title="Simple Rating"
name="Rating"
x-component-props={{
allowHalf: true,
}}
/>
<Field
x-component="Rating"
title="readOnly"
name="readOnly"
readOnly
x-component-props={{
allowHalf: true,
}}
/>
</SchemaForm>
);
};
ReactDOM.render(<App />, mountNode);
```