<div class="demo-caption">On anything</div>
<div class="demo-indicator-row">
<ray-indicator label="New" size="16" offset="6"><ray-avatar name="Ray Remote" color="violet" size="xl" radius="md"></ray-avatar></ray-indicator>
<ray-indicator label="3" color="red" with-border offset="4"><ray-icon-button variant="default" size="lg" label="Notifications, 3 unread"><ray-icon name="bell"></ray-icon></ray-icon-button></ray-indicator>
<ray-indicator label="12" max="9" color="red"><ray-button variant="default">Inbox</ray-button></ray-indicator>
<ray-indicator label="Beta" color="teal" position="top-start" radius="sm"><ray-card with-border padding="md"><div class="demo-indicator-card"><strong>Native builds</strong><span>ray build --native</span></div></ray-card></ray-indicator>
<p style="margin: 0">Messages <ray-indicator inline size="8" color="red" offset="-6" position="middle-end"><span role="img" aria-label="unread"> </span></ray-indicator></p>
</div>
<div class="demo-caption">Status</div>
<div class="demo-indicator-row">
<ray-indicator position="bottom-end" offset="7" size="14" color="green" with-border><ray-avatar name="Grace Hopper" color="teal" size="lg" aria-label="Grace Hopper, online"></ray-avatar></ray-indicator>
<ray-indicator position="bottom-end" offset="7" size="14" color="yellow" with-border><ray-avatar name="Alan Turing" color="blue" size="lg" aria-label="Alan Turing, away"></ray-avatar></ray-indicator>
<ray-indicator position="bottom-end" offset="7" size="14" color="gray" with-border><ray-avatar name="Ada Lovelace" color="pink" size="lg" aria-label="Ada Lovelace, offline"></ray-avatar></ray-indicator>
<ray-indicator label="Live" color="red" processing offset="10" position="top-start" radius="sm"><div class="demo-indicator-video">ray-remote · screen</div></ray-indicator>
<ray-indicator processing color="green" size="10" offset="3"><ray-badge variant="outline" color="gray" normal-case>Syncing</ray-badge></ray-indicator>
</div>
<div class="demo-caption">Positions</div>
<div class="demo-scroll"><div class="demo-indicator-positions">
<ray-indicator position="top-start" label="top-start" color="gray"><div class="demo-indicator-box"></div></ray-indicator>
<ray-indicator position="top-center" label="top-center" color="gray"><div class="demo-indicator-box"></div></ray-indicator>
<ray-indicator position="top-end" label="top-end" color="gray"><div class="demo-indicator-box"></div></ray-indicator>
<ray-indicator position="middle-start" label="middle-start" color="gray"><div class="demo-indicator-box"></div></ray-indicator>
<ray-indicator position="middle-center" label="middle-center" color="gray"><div class="demo-indicator-box"></div></ray-indicator>
<ray-indicator position="middle-end" label="middle-end" color="gray"><div class="demo-indicator-box"></div></ray-indicator>
<ray-indicator position="bottom-start" label="bottom-start" color="gray"><div class="demo-indicator-box"></div></ray-indicator>
<ray-indicator position="bottom-center" label="bottom-center" color="gray"><div class="demo-indicator-box"></div></ray-indicator>
<ray-indicator position="bottom-end" label="bottom-end" color="gray"><div class="demo-indicator-box"></div></ray-indicator>
</div></div>
<div class="demo-caption">Counts, colors and sizes</div>
<div class="demo-indicator-row">
<ray-indicator id="demo-count" label="1" max="99" color="red" with-border offset="4"><ray-icon-button variant="light" size="lg" label="Messages"><ray-icon name="paperclip"></ray-icon></ray-icon-button></ray-indicator>
<ray-button size="xs" variant="default" id="demo-count-more">+ 25</ray-button>
<ray-button size="xs" variant="subtle" id="demo-count-clear">Mark read</ray-button>
<span class="demo-indicator-sep"></span>
<ray-indicator color="blue"><div class="demo-indicator-box sm"></div></ray-indicator>
<ray-indicator color="teal" size="14"><div class="demo-indicator-box sm"></div></ray-indicator>
<ray-indicator color="orange" size="18" with-border><div class="demo-indicator-box sm"></div></ray-indicator>
<ray-indicator color="#db2777" label="#db2777"><div class="demo-indicator-box sm"></div></ray-indicator>
</div>
<script type="module">
const count = document.getElementById("demo-count");
let n = 1;
const show = () => { count.label = String(n); count.disabled = n === 0; };
document.getElementById("demo-count-more").addEventListener("click", () => { n += 25; show(); });
document.getElementById("demo-count-clear").addEventListener("click", () => { n = 0; show(); });
</script>
import { RayIndicator, RayAvatar, RayIconButton, RayIcon, RayButton, RayCard, RayBadge } from "@raylang/react";
export function IndicatorExample() {
return (
<>
<div className="demo-caption">On anything</div>
<div className="demo-indicator-row">
<RayIndicator label="New" size="16" offset="6"><RayAvatar name="Ray Remote" color="violet" size="xl" radius="md" /></RayIndicator>
<RayIndicator label="3" color="red" withBorder offset="4"><RayIconButton variant="default" size="lg" label="Notifications, 3 unread"><RayIcon name="bell" /></RayIconButton></RayIndicator>
<RayIndicator label="12" max={9} color="red"><RayButton variant="default">Inbox</RayButton></RayIndicator>
<RayIndicator label="Beta" color="teal" position="top-start" radius="sm"><RayCard withBorder padding="md"><div className="demo-indicator-card"><strong>Native builds</strong><span>ray build --native</span></div></RayCard></RayIndicator>
<p style={{ margin: "0" }}>Messages <RayIndicator inline size="8" color="red" offset="-6" position="middle-end"><span role="img" aria-label="unread"> </span></RayIndicator></p>
</div>
<div className="demo-caption">Status</div>
<div className="demo-indicator-row">
<RayIndicator position="bottom-end" offset="7" size="14" color="green" withBorder><RayAvatar name="Grace Hopper" color="teal" size="lg" aria-label="Grace Hopper, online" /></RayIndicator>
<RayIndicator position="bottom-end" offset="7" size="14" color="yellow" withBorder><RayAvatar name="Alan Turing" color="blue" size="lg" aria-label="Alan Turing, away" /></RayIndicator>
<RayIndicator position="bottom-end" offset="7" size="14" color="gray" withBorder><RayAvatar name="Ada Lovelace" color="pink" size="lg" aria-label="Ada Lovelace, offline" /></RayIndicator>
<RayIndicator label="Live" color="red" processing offset="10" position="top-start" radius="sm"><div className="demo-indicator-video">ray-remote · screen</div></RayIndicator>
<RayIndicator processing color="green" size="10" offset="3"><RayBadge variant="outline" color="gray" normalCase>Syncing</RayBadge></RayIndicator>
</div>
<div className="demo-caption">Positions</div>
<div className="demo-scroll"><div className="demo-indicator-positions">
<RayIndicator position="top-start" label="top-start" color="gray"><div className="demo-indicator-box" /></RayIndicator>
<RayIndicator position="top-center" label="top-center" color="gray"><div className="demo-indicator-box" /></RayIndicator>
<RayIndicator position="top-end" label="top-end" color="gray"><div className="demo-indicator-box" /></RayIndicator>
<RayIndicator position="middle-start" label="middle-start" color="gray"><div className="demo-indicator-box" /></RayIndicator>
<RayIndicator position="middle-center" label="middle-center" color="gray"><div className="demo-indicator-box" /></RayIndicator>
<RayIndicator position="middle-end" label="middle-end" color="gray"><div className="demo-indicator-box" /></RayIndicator>
<RayIndicator position="bottom-start" label="bottom-start" color="gray"><div className="demo-indicator-box" /></RayIndicator>
<RayIndicator position="bottom-center" label="bottom-center" color="gray"><div className="demo-indicator-box" /></RayIndicator>
<RayIndicator position="bottom-end" label="bottom-end" color="gray"><div className="demo-indicator-box" /></RayIndicator>
</div></div>
<div className="demo-caption">Counts, colors and sizes</div>
<div className="demo-indicator-row">
<RayIndicator id="demo-count" label="1" max={99} color="red" withBorder offset="4"><RayIconButton variant="light" size="lg" label="Messages"><RayIcon name="paperclip" /></RayIconButton></RayIndicator>
<RayButton size="xs" variant="default" id="demo-count-more">+ 25</RayButton>
<RayButton size="xs" variant="subtle" id="demo-count-clear">Mark read</RayButton>
<span className="demo-indicator-sep" />
<RayIndicator color="blue"><div className="demo-indicator-box sm" /></RayIndicator>
<RayIndicator color="teal" size="14"><div className="demo-indicator-box sm" /></RayIndicator>
<RayIndicator color="orange" size="18" withBorder><div className="demo-indicator-box sm" /></RayIndicator>
<RayIndicator color="#db2777" label="#db2777"><div className="demo-indicator-box sm" /></RayIndicator>
</div>
</>
);
}
<template>
<div class="demo-caption">On anything</div>
<div class="demo-indicator-row">
<RayIndicator label="New" size="16" offset="6"><RayAvatar name="Ray Remote" color="violet" size="xl" radius="md" /></RayIndicator>
<RayIndicator label="3" color="red" with-border offset="4"><RayIconButton variant="default" size="lg" label="Notifications, 3 unread"><RayIcon name="bell" /></RayIconButton></RayIndicator>
<RayIndicator label="12" :max="9" color="red"><RayButton variant="default">Inbox</RayButton></RayIndicator>
<RayIndicator label="Beta" color="teal" position="top-start" radius="sm"><RayCard with-border padding="md"><div class="demo-indicator-card"><strong>Native builds</strong><span>ray build --native</span></div></RayCard></RayIndicator>
<p style="margin: 0">Messages <RayIndicator inline size="8" color="red" offset="-6" position="middle-end"><span role="img" aria-label="unread"> </span></RayIndicator></p>
</div>
<div class="demo-caption">Status</div>
<div class="demo-indicator-row">
<RayIndicator position="bottom-end" offset="7" size="14" color="green" with-border><RayAvatar name="Grace Hopper" color="teal" size="lg" aria-label="Grace Hopper, online" /></RayIndicator>
<RayIndicator position="bottom-end" offset="7" size="14" color="yellow" with-border><RayAvatar name="Alan Turing" color="blue" size="lg" aria-label="Alan Turing, away" /></RayIndicator>
<RayIndicator position="bottom-end" offset="7" size="14" color="gray" with-border><RayAvatar name="Ada Lovelace" color="pink" size="lg" aria-label="Ada Lovelace, offline" /></RayIndicator>
<RayIndicator label="Live" color="red" processing offset="10" position="top-start" radius="sm"><div class="demo-indicator-video">ray-remote · screen</div></RayIndicator>
<RayIndicator processing color="green" size="10" offset="3"><RayBadge variant="outline" color="gray" normal-case>Syncing</RayBadge></RayIndicator>
</div>
<div class="demo-caption">Positions</div>
<div class="demo-scroll"><div class="demo-indicator-positions">
<RayIndicator position="top-start" label="top-start" color="gray"><div class="demo-indicator-box"></div></RayIndicator>
<RayIndicator position="top-center" label="top-center" color="gray"><div class="demo-indicator-box"></div></RayIndicator>
<RayIndicator position="top-end" label="top-end" color="gray"><div class="demo-indicator-box"></div></RayIndicator>
<RayIndicator position="middle-start" label="middle-start" color="gray"><div class="demo-indicator-box"></div></RayIndicator>
<RayIndicator position="middle-center" label="middle-center" color="gray"><div class="demo-indicator-box"></div></RayIndicator>
<RayIndicator position="middle-end" label="middle-end" color="gray"><div class="demo-indicator-box"></div></RayIndicator>
<RayIndicator position="bottom-start" label="bottom-start" color="gray"><div class="demo-indicator-box"></div></RayIndicator>
<RayIndicator position="bottom-center" label="bottom-center" color="gray"><div class="demo-indicator-box"></div></RayIndicator>
<RayIndicator position="bottom-end" label="bottom-end" color="gray"><div class="demo-indicator-box"></div></RayIndicator>
</div></div>
<div class="demo-caption">Counts, colors and sizes</div>
<div class="demo-indicator-row">
<RayIndicator id="demo-count" label="1" :max="99" color="red" with-border offset="4"><RayIconButton variant="light" size="lg" label="Messages"><RayIcon name="paperclip" /></RayIconButton></RayIndicator>
<RayButton size="xs" variant="default" id="demo-count-more">+ 25</RayButton>
<RayButton size="xs" variant="subtle" id="demo-count-clear">Mark read</RayButton>
<span class="demo-indicator-sep"></span>
<RayIndicator color="blue"><div class="demo-indicator-box sm"></div></RayIndicator>
<RayIndicator color="teal" size="14"><div class="demo-indicator-box sm"></div></RayIndicator>
<RayIndicator color="orange" size="18" with-border><div class="demo-indicator-box sm"></div></RayIndicator>
<RayIndicator color="#db2777" label="#db2777"><div class="demo-indicator-box sm"></div></RayIndicator>
</div>
</template>