{
+ const dom = ref.current;
+ if (!dom) {
+ return;
+ }
+ const rect = dom.getBoundingClientRect();
+ const isLeft = e.clientX < rect.x + rect.width / 2;
+ onClick?.(isLeft ? 'left' : 'right', e);
+ }}
+ style={style}
+ className={cx(iconClass, {
+ [`${iconClass}--current`]: isCurrent,
+ [`${iconClass}--selected`]: isSelected && !isHalf,
+ [`${iconClass}--unselected`]: !isSelected || isHalf,
+ })}
+ >
+ {isHalf ? (
+
+ {iconNode}
+
+ ) : null}
+
+ {iconNode}
+
+ );
+};
diff --git a/src/rate/RateText.tsx b/src/rate/RateText.tsx
new file mode 100644
index 00000000..aaaf3fa6
--- /dev/null
+++ b/src/rate/RateText.tsx
@@ -0,0 +1,29 @@
+import cx from 'classnames';
+import React from 'react';
+import useConfig from 'tdesign-mobile-react/_util/useConfig';
+import { TdRateProps } from './type';
+
+type Props = {
+ texts: TdRateProps['texts'];
+ value: number;
+};
+
+export const RateText = (props: Props) => {
+ const { classPrefix } = useConfig();
+
+ const textClass = `${classPrefix}-rate__text`;
+
+ const { value, texts } = props;
+
+ const text = (Array.isArray(texts) ? texts[value - 1] : '') || `${value}分`;
+
+ return (
+