MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Meter

Function Meter

starters/docs/src/Meter.tsx:10–37  ·  view source on GitHub ↗
({label, ...props}: MeterProps)

Source from the content-addressed store, hash-verified

8}
9
10export function Meter({label, ...props}: MeterProps) {
11 return (
12 <AriaMeter {...props}>
13 {({percentage, valueText}) => (
14 <>
15 <Label>{label}</Label>
16 <span className="value">{valueText}</span>
17 <div className="track inset">
18 <div
19 className="fill"
20 style={
21 {
22 width: percentage + '%',
23 '--fill-color':
24 percentage < 70
25 ? 'var(--green)'
26 : percentage < 90
27 ? 'var(--orange)'
28 : 'var(--red)'
29 } as any
30 }
31 />
32 </div>
33 </>
34 )}
35 </AriaMeter>
36 );
37}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected