ui.meter · parts: Meter · elements: <meter>
Meter is a native gauge for a known range (value/min/max).
No additional notes for Meter yet.
Meter renders a native meter; children are the fallback text.
| Canonical (templ, Jinja2, MiniJinja) | React / Solid | HTML (Svelte, Vue, WC) | Type | Default | Kind | Description |
|---|---|---|---|---|---|---|
Value |
value |
value |
string |
— | passthrough attr | |
Min |
min |
min |
string |
— | passthrough attr | |
Max |
max |
max |
string |
— | passthrough attr | |
Low |
low |
low |
string |
— | passthrough attr | |
High |
high |
high |
string |
— | passthrough attr | |
Optimum |
optimum |
optimum |
string |
— | passthrough attr | |
AriaLabel |
aria-label |
aria-label |
string |
— | passthrough attr |
Also accepts: class (className in React), extra attributes (rest props in UI frameworks, Attrs in templ/Jinja2/MiniJinja, attrs in Twig/Latte; caller wins), children.
No variants: the primitive ships no visual classes; style it with token classes via class.
Accepts children (default slot / children / { children... } / trusted HTML string in Twig, Latte, Jinja2, MiniJinja — see runtimes). Void tags selected via tag render no children.
- Computed/forwarded:
aria-label(omitted when empty). - Typed ARIA props:
aria-label— static values only.
Compose the part's classes without rendering it (custom root element, no asChild outside React):
| Runtime | Helper |
|---|---|
| React / Solid / Vue / Svelte / WC | meterClasses({ ... }) from meter/meter.shared.ts |
| templ | meter.MeterClasses(meter.MeterProps{...}) |
| Twig | ui8kit_classes('meterClasses', { class: '…' }) |
| Latte | \UI8Kit\Latte\Classes::meterClasses(['class' => '…']) |
| Jinja2 | meter_classes(p) |
| MiniJinja | meter_classes(p) (registered by ui8kit_minijinja::register) |
Canonical renderer output (children = Content); all 10 runtimes are parity-tested to produce this DOM.
| State | Props | HTML |
|---|---|---|
| defaults | — | <meter>Content</meter> |
| full | {"Value":"0.6","Min":"0","Max":"1","Low":"0.2","High":"0.8","Optimum":"0.5","AriaLabel":"Disk"} |
<meter value="0.6" min="0" max="1" low="0.2" high="0.8" optimum="0.5" aria-label="Disk">Content</meter> |
Fixture full ({"Value":"0.6","Min":"0","Max":"1","Low":"0.2","High":"0.8","Optimum":"0.5","AriaLabel":"Disk"}) — every snippet renders:
<meter value="0.6" min="0" max="1" low="0.2" high="0.8" optimum="0.5" aria-label="Disk">Content</meter>React (runtime notes)
import { Meter } from "./ui/meter/meter";
<Meter value="0.6" min="0" max="1" low="0.2" high="0.8" optimum="0.5" aria-label="Disk">Content</Meter>Vue 3 (runtime notes)
<script setup lang="ts">
import Meter from "./ui/meter/Meter.vue";
</script>
<template>
<Meter value="0.6" min="0" max="1" low="0.2" high="0.8" optimum="0.5" aria-label="Disk">Content</Meter>
</template>Svelte 5 (runtime notes)
<script lang="ts">
import Meter from "./ui/meter/Meter.svelte";
</script>
<Meter value="0.6" min="0" max="1" low="0.2" high="0.8" optimum="0.5" aria-label="Disk">Content</Meter>SolidJS (runtime notes)
import { Meter } from "./ui/meter/meter.solid";
<Meter value="0.6" min="0" max="1" low="0.2" high="0.8" optimum="0.5" aria-label="Disk">Content</Meter>Web Components (runtime notes)
import { renderMeter } from "./ui/meter/meter.wc";
document.body.append(renderMeter({ value: "0.6", min: "0", max: "1", low: "0.2", high: "0.8", optimum: "0.5", "aria-label": "Disk" }, "Content"));Go templ (runtime notes)
import "github.com/ui8kit/codegen/generated/templ/ui/meter"
@meter.Meter(meter.MeterProps{Value: new("0.6"), Min: "0", Max: "1", Low: "0.2", High: "0.8", Optimum: "0.5", AriaLabel: "Disk"}) {
Content
}Twig (runtime notes)
{% include 'meter/Meter.html.twig' with { value: '0.6', min: '0', max: '1', low: '0.2', high: '0.8', optimum: '0.5', ariaLabel: 'Disk', children: 'Content' } only %}Latte (runtime notes)
{include 'meter/Meter.latte', value: '0.6', min: '0', max: '1', low: '0.2', high: '0.8', optimum: '0.5', ariaLabel: 'Disk', children: 'Content'}Jinja2 (runtime notes)
{% with p = {'Value': '0.6', 'Min': '0', 'Max': '1', 'Low': '0.2', 'High': '0.8', 'Optimum': '0.5', 'AriaLabel': 'Disk'}, children = 'Content' %}{% include 'ui/meter/meter.html.j2' %}{% endwith %}MiniJinja (Rust) (runtime notes)
{% import 'ui8kit.html' as ui %}
{{ ui.meter({'Value': '0.6', 'Min': '0', 'Max': '1', 'Low': '0.2', 'High': '0.8', 'Optimum': '0.5', 'AriaLabel': 'Disk'}, children='Content') }}