Skip to content

Commit c0ff278

Browse files
committed
add docs for component
1 parent 6926539 commit c0ff278

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

docs/components/meter.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# matestack core component: Main
2+
3+
Show [specs](/spec/usage/components/meter_spec.rb)
4+
5+
Use the Meter component to implement `<meter>` tag.
6+
7+
## Parameters
8+
9+
#### # value (required)
10+
Expects a number thats is the current value of the gauge.
11+
12+
#### # id (optional)
13+
Expects a string with all ids the main should have.
14+
15+
#### # class (optional)
16+
Expects a string with all classes the main should have.
17+
18+
#### # min (optional)
19+
Expects a number that defines the minimum value of the range.
20+
21+
#### # max (optional)
22+
Expects a number that defines the maximum value of the range.
23+
24+
#### # low (optional)
25+
Expects a number that defines which value is considered a low value
26+
27+
#### # high (optional)
28+
Expects a number that defines which value is considered a high value
29+
30+
#### # optimum (optional)
31+
Expects a number that defines which value is optimal for the gauge
32+
33+
34+
35+
36+
## Example
37+
38+
```ruby
39+
meter id: 'meter_id', value: 0.6
40+
41+
meter id: 'meter', min: 0, max: 10, value: 6 do
42+
plain '6 out of 10. 60%.'
43+
end
44+
45+
meter id: 'meter', low: 2, high: 8, optimum: 6, min: 0, max: 10, value: 6 do
46+
plain '6 out of 10. 60%.'
47+
end
48+
```
49+
50+
returns
51+
52+
```html
53+
<meter id="meter_id" value="0.6"></meter>
54+
55+
<meter id="meter" max="10" min="0" value="6">6 out of 10. 60%.</meter>
56+
57+
<meter high="8" id="meter" low="2" max="10" min="0" optimum="6" value="6">
58+
6 out of 10. 60%.
59+
</meter>
60+
```

0 commit comments

Comments
 (0)