<div class="demo-caption">Rounds of a timer</div>
<ray-stack gap="sm" align="center">
<ray-step-dots id="demo-dots-rounds" count="12" value="3" label="Round"></ray-step-dots>
<ray-group gap="xs">
<ray-button size="xs" variant="default" id="demo-dots-prev">Previous</ray-button>
<ray-button size="xs" variant="default" id="demo-dots-next">Next</ray-button>
</ray-group>
<span class="demo-muted" id="demo-dots-text"></span>
</ray-stack>
<div class="demo-caption">Another language: value-text</div>
<ray-step-dots lang="es" count="8" value="2" label="Asalto" value-text="Asalto {step} de {count}" done-text="{count} asaltos hechos" color="red"></ray-step-dots>
<p class="demo-muted" style="margin: 0">Announced «Asalto 3 de 8»: <code>{step}</code> and <code>{count}</code> are replaced, the numbers follow the page's language.</p>
<div class="demo-caption">Sizes, colors and alignment</div>
<ray-stack gap="md">
<ray-step-dots count="5" value="1" size="xs" align="start"></ray-step-dots>
<ray-step-dots count="5" value="2" size="md" color="teal" align="start"></ray-step-dots>
<ray-step-dots count="5" value="3" size="lg" color="orange" align="start"></ray-step-dots>
<ray-step-dots count="5" value="5" size="xl" color="green" align="start" label="Page"></ray-step-dots>
</ray-stack>
<p class="demo-muted" style="margin: 0">value is the current step from 0; value = count: all done.</p>
<script type="module">
const dots = document.getElementById("demo-dots-rounds");
const text = document.getElementById("demo-dots-text");
const paint = () => (text.textContent = dots.value >= dots.count ? "Done" : `Round ${dots.value + 1} of ${dots.count}`);
document.getElementById("demo-dots-prev").addEventListener("click", () => { dots.value = Math.max(0, dots.value - 1); paint(); });
document.getElementById("demo-dots-next").addEventListener("click", () => { dots.value = Math.min(dots.count, dots.value + 1); paint(); });
paint();
</script>
import { RayStack, RayStepDots, RayGroup, RayButton } from "@raylang/react";
export function StepDotsExample() {
return (
<>
<div className="demo-caption">Rounds of a timer</div>
<RayStack gap="sm" align="center">
<RayStepDots id="demo-dots-rounds" count={12} value={3} label="Round" />
<RayGroup gap="xs">
<RayButton size="xs" variant="default" id="demo-dots-prev">Previous</RayButton>
<RayButton size="xs" variant="default" id="demo-dots-next">Next</RayButton>
</RayGroup>
<span className="demo-muted" id="demo-dots-text" />
</RayStack>
<div className="demo-caption">Another language: value-text</div>
<RayStepDots lang="es" count={8} value={2} label="Asalto" valueText="Asalto {step} de {count}" doneText="{count} asaltos hechos" color="red" />
<p className="demo-muted" style={{ margin: "0" }}>Announced «Asalto 3 de 8»: <code>{"{"{"}"}step{"}"}</code> and <code>{"{"{"}"}count{"}"}</code> are replaced, the numbers follow the page's language.</p>
<div className="demo-caption">Sizes, colors and alignment</div>
<RayStack gap="md">
<RayStepDots count={5} value={1} size="xs" align="start" />
<RayStepDots count={5} value={2} size="md" color="teal" align="start" />
<RayStepDots count={5} value={3} size="lg" color="orange" align="start" />
<RayStepDots count={5} value={5} size="xl" color="green" align="start" label="Page" />
</RayStack>
<p className="demo-muted" style={{ margin: "0" }}>value is the current step from 0; value = count: all done.</p>
</>
);
}
<template>
<div class="demo-caption">Rounds of a timer</div>
<RayStack gap="sm" align="center">
<RayStepDots id="demo-dots-rounds" :count="12" :value="3" label="Round" />
<RayGroup gap="xs">
<RayButton size="xs" variant="default" id="demo-dots-prev">Previous</RayButton>
<RayButton size="xs" variant="default" id="demo-dots-next">Next</RayButton>
</RayGroup>
<span class="demo-muted" id="demo-dots-text"></span>
</RayStack>
<div class="demo-caption">Another language: value-text</div>
<RayStepDots lang="es" :count="8" :value="2" label="Asalto" value-text="Asalto {step} de {count}" done-text="{count} asaltos hechos" color="red" />
<p class="demo-muted" style="margin: 0">Announced «Asalto 3 de 8»: <code>{step}</code> and <code>{count}</code> are replaced, the numbers follow the page's language.</p>
<div class="demo-caption">Sizes, colors and alignment</div>
<RayStack gap="md">
<RayStepDots :count="5" :value="1" size="xs" align="start" />
<RayStepDots :count="5" :value="2" size="md" color="teal" align="start" />
<RayStepDots :count="5" :value="3" size="lg" color="orange" align="start" />
<RayStepDots :count="5" :value="5" size="xl" color="green" align="start" label="Page" />
</RayStack>
<p class="demo-muted" style="margin: 0">value is the current step from 0; value = count: all done.</p>
</template>