@wonderflow/react-components
Version:
UI components from Wonderflow's Wanda design system
37 lines • 1.21 kB
TypeScript
import { ReactNode } from 'react';
import { Polymorphic, Stack } from '../..';
export declare type StarMeterProps = {
/**
* Set the value of the star meter.
* This value must be between `0` and `starCount`.
*
* This data is used to calculate the number of filled stars
* based on predefined thresholds of the fraction.
*
* @example
* fraction < `0.25` = rounded to 0 (empty star)
* fraction >= `0.75` = rounded to 1 (filled star)
* fraction >= `0.25` and < 0.75 = rounded to 0.5 (half star)
*/
value: number;
/**
* Set the number of stars to use as maximum.
*/
starCount?: number;
/**
* Set a custom label instead of the current value.
*/
label?: ReactNode;
/**
* Set the size of the star meter.
*/
dimension?: 'small' | 'regular' | 'big';
/**
* Hide the label beside the stars
*/
hideLabel?: boolean;
};
declare type PolymorphicStarMeter = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Stack>, Polymorphic.OwnProps<typeof Stack> & StarMeterProps>;
export declare const StarMeter: PolymorphicStarMeter;
export {};
//# sourceMappingURL=star-meter.d.ts.map