SxRating (评分)
星级评分组件。对齐 Microsoft Fluent UI Blazor Rating (v4.13.2) 的 API 结构,并说明 NextUI 当前实现状态。
使用场景
约束说明
Max 控制最大星级。
ReadOnly 为真时不可交互。
行为说明
- 点击星级更新
Value。
- 重复点击当前值不改变。
API
Parameters (参数)
| 状态 |
参数名 |
类型 |
默认值 |
描述 |
| Implemented |
Value |
int |
0 |
当前评分。 |
| Implemented |
Max |
int |
5 |
最大评分。 |
| Implemented |
Icon |
string? |
null |
自定义图标。 |
| Implemented |
ReadOnly |
bool |
false |
只读状态。 |
| Implemented |
Disabled (继承) |
bool |
false |
禁用状态。 |
| Implemented |
Id (继承) |
string? |
null |
组件 Id。 |
| Implemented |
Class (继承) |
string? |
null |
CSS 类名。 |
| Implemented |
Style (继承) |
string? |
null |
自定义样式。 |
| Implemented |
Title (继承) |
string? |
null |
HTML title。 |
| Implemented |
AdditionalAttributes (继承) |
IEnumerable<KeyValuePair<string, object>>? |
null |
额外属性。 |
Events (事件)
| 状态 |
事件名 |
类型 |
描述 |
| Implemented |
ValueChanged |
EventCallback<int> |
评分改变时触发。 |
示例
<SxRating @bind-Value="_rating" Max="5" />
参考设计 (References)