<div class="demo-caption">Variants × colors</div>
<div class="demo-scroll">
<div class="demo-matrix" style="--demo-cols: 6">
<span></span><span class="demo-matrix-head">primary</span><span class="demo-matrix-head">gray</span><span class="demo-matrix-head">red</span><span class="demo-matrix-head">green</span><span class="demo-matrix-head">yellow</span><span class="demo-matrix-head">violet</span>
<span class="demo-matrix-label">light (default)</span><ray-badge>Info</ray-badge><ray-badge color="gray">Draft</ray-badge><ray-badge color="red">Failed</ray-badge><ray-badge color="green">Passed</ray-badge><ray-badge color="yellow">Pending</ray-badge><ray-badge color="violet">Beta</ray-badge>
<span class="demo-matrix-label">filled</span><ray-badge variant="filled">Info</ray-badge><ray-badge variant="filled" color="gray">Draft</ray-badge><ray-badge variant="filled" color="red">Failed</ray-badge><ray-badge variant="filled" color="green">Passed</ray-badge><ray-badge variant="filled" color="yellow">Pending</ray-badge><ray-badge variant="filled" color="violet">Beta</ray-badge>
<span class="demo-matrix-label">outline</span><ray-badge variant="outline">Info</ray-badge><ray-badge variant="outline" color="gray">Draft</ray-badge><ray-badge variant="outline" color="red">Failed</ray-badge><ray-badge variant="outline" color="green">Passed</ray-badge><ray-badge variant="outline" color="yellow">Pending</ray-badge><ray-badge variant="outline" color="violet">Beta</ray-badge>
<span class="demo-matrix-label">dot</span><ray-badge variant="dot">Info</ray-badge><ray-badge variant="dot" color="gray">Draft</ray-badge><ray-badge variant="dot" color="red">Failed</ray-badge><ray-badge variant="dot" color="green">Passed</ray-badge><ray-badge variant="dot" color="yellow">Pending</ray-badge><ray-badge variant="dot" color="violet">Beta</ray-badge>
<span class="demo-matrix-label">default</span><ray-badge variant="default">Neutral</ray-badge><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span>
<span class="demo-matrix-label">gradient</span><ray-badge variant="gradient">New</ray-badge><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span>
</div>
</div>
<p class="demo-muted" style="margin: 0">default is the neutral surface and ignores color; gradient takes <code>gradient="from to [deg]"</code>.</p>
<div class="demo-caption">Gradient</div>
<div class="demo-row">
<ray-badge variant="gradient">Theme</ray-badge>
<ray-badge variant="gradient" gradient="pink orange 90">pink → orange</ray-badge>
<ray-badge variant="gradient" gradient="teal blue 135">teal → blue</ray-badge>
</div>
<div class="demo-caption">Sizes</div>
<div class="demo-row">
<ray-badge size="xs">Extra small</ray-badge>
<ray-badge size="sm">Small</ray-badge>
<ray-badge size="md">Medium</ray-badge>
<ray-badge size="lg">Large</ray-badge>
<ray-badge size="xl">Extra large</ray-badge>
</div>
<div class="demo-caption">Radius and case</div>
<div class="demo-row">
<ray-badge variant="filled" color="gray" radius="xs">xs</ray-badge>
<ray-badge variant="filled" color="gray" radius="sm">sm</ray-badge>
<ray-badge variant="filled" color="gray" radius="md">md</ray-badge>
<ray-badge variant="filled" color="gray" radius="lg">lg</ray-badge>
<ray-badge variant="filled" color="gray">full (default)</ray-badge>
<ray-badge variant="outline" color="gray" normal-case>v1.27.37 · normal-case</ray-badge>
</div>
<div class="demo-caption">In context</div>
<ul class="demo-list" style="max-width: 32rem">
<li><span class="grow">ray-remote · build #412</span><ray-badge variant="dot" color="green">Online</ray-badge></li>
<li><span class="grow">rayauth · build #108</span><ray-badge variant="filled" color="red">Failed</ray-badge></li>
<li><span class="grow">ray-elements · release 0.5.0</span><ray-badge color="yellow">Pending</ray-badge></li>
</ul>
<div class="demo-row">
<ray-button variant="default">Inbox<ray-badge slot="right" size="xs" variant="filled" color="red">3</ray-badge></ray-button>
<ray-button variant="light">Releases<ray-badge slot="right" size="xs" color="gray" normal-case>v0.5</ray-badge></ray-button>
</div>
import type { CSSProperties } from "react";
import { RayBadge, RayButton } from "@raylang/react";
export function BadgeExample() {
return (
<>
<div className="demo-caption">Variants × colors</div>
<div className="demo-scroll">
<div className="demo-matrix" style={{ "--demo-cols": "6" } as CSSProperties}>
<span /><span className="demo-matrix-head">primary</span><span className="demo-matrix-head">gray</span><span className="demo-matrix-head">red</span><span className="demo-matrix-head">green</span><span className="demo-matrix-head">yellow</span><span className="demo-matrix-head">violet</span>
<span className="demo-matrix-label">light (default)</span><RayBadge>Info</RayBadge><RayBadge color="gray">Draft</RayBadge><RayBadge color="red">Failed</RayBadge><RayBadge color="green">Passed</RayBadge><RayBadge color="yellow">Pending</RayBadge><RayBadge color="violet">Beta</RayBadge>
<span className="demo-matrix-label">filled</span><RayBadge variant="filled">Info</RayBadge><RayBadge variant="filled" color="gray">Draft</RayBadge><RayBadge variant="filled" color="red">Failed</RayBadge><RayBadge variant="filled" color="green">Passed</RayBadge><RayBadge variant="filled" color="yellow">Pending</RayBadge><RayBadge variant="filled" color="violet">Beta</RayBadge>
<span className="demo-matrix-label">outline</span><RayBadge variant="outline">Info</RayBadge><RayBadge variant="outline" color="gray">Draft</RayBadge><RayBadge variant="outline" color="red">Failed</RayBadge><RayBadge variant="outline" color="green">Passed</RayBadge><RayBadge variant="outline" color="yellow">Pending</RayBadge><RayBadge variant="outline" color="violet">Beta</RayBadge>
<span className="demo-matrix-label">dot</span><RayBadge variant="dot">Info</RayBadge><RayBadge variant="dot" color="gray">Draft</RayBadge><RayBadge variant="dot" color="red">Failed</RayBadge><RayBadge variant="dot" color="green">Passed</RayBadge><RayBadge variant="dot" color="yellow">Pending</RayBadge><RayBadge variant="dot" color="violet">Beta</RayBadge>
<span className="demo-matrix-label">default</span><RayBadge variant="default">Neutral</RayBadge><span className="demo-muted">—</span><span className="demo-muted">—</span><span className="demo-muted">—</span><span className="demo-muted">—</span><span className="demo-muted">—</span>
<span className="demo-matrix-label">gradient</span><RayBadge variant="gradient">New</RayBadge><span className="demo-muted">—</span><span className="demo-muted">—</span><span className="demo-muted">—</span><span className="demo-muted">—</span><span className="demo-muted">—</span>
</div>
</div>
<p className="demo-muted" style={{ margin: "0" }}>default is the neutral surface and ignores color; gradient takes <code>gradient="from to [deg]"</code>.</p>
<div className="demo-caption">Gradient</div>
<div className="demo-row">
<RayBadge variant="gradient">Theme</RayBadge>
<RayBadge variant="gradient" gradient="pink orange 90">pink → orange</RayBadge>
<RayBadge variant="gradient" gradient="teal blue 135">teal → blue</RayBadge>
</div>
<div className="demo-caption">Sizes</div>
<div className="demo-row">
<RayBadge size="xs">Extra small</RayBadge>
<RayBadge size="sm">Small</RayBadge>
<RayBadge size="md">Medium</RayBadge>
<RayBadge size="lg">Large</RayBadge>
<RayBadge size="xl">Extra large</RayBadge>
</div>
<div className="demo-caption">Radius and case</div>
<div className="demo-row">
<RayBadge variant="filled" color="gray" radius="xs">xs</RayBadge>
<RayBadge variant="filled" color="gray" radius="sm">sm</RayBadge>
<RayBadge variant="filled" color="gray" radius="md">md</RayBadge>
<RayBadge variant="filled" color="gray" radius="lg">lg</RayBadge>
<RayBadge variant="filled" color="gray">full (default)</RayBadge>
<RayBadge variant="outline" color="gray" normalCase>v1.27.37 · normal-case</RayBadge>
</div>
<div className="demo-caption">In context</div>
<ul className="demo-list" style={{ maxWidth: "32rem" }}>
<li><span className="grow">ray-remote · build #412</span><RayBadge variant="dot" color="green">Online</RayBadge></li>
<li><span className="grow">rayauth · build #108</span><RayBadge variant="filled" color="red">Failed</RayBadge></li>
<li><span className="grow">ray-elements · release 0.5.0</span><RayBadge color="yellow">Pending</RayBadge></li>
</ul>
<div className="demo-row">
<RayButton variant="default">Inbox<RayBadge slot="right" size="xs" variant="filled" color="red">3</RayBadge></RayButton>
<RayButton variant="light">Releases<RayBadge slot="right" size="xs" color="gray" normalCase>v0.5</RayBadge></RayButton>
</div>
</>
);
}
<template>
<div class="demo-caption">Variants × colors</div>
<div class="demo-scroll">
<div class="demo-matrix" style="--demo-cols: 6">
<span></span><span class="demo-matrix-head">primary</span><span class="demo-matrix-head">gray</span><span class="demo-matrix-head">red</span><span class="demo-matrix-head">green</span><span class="demo-matrix-head">yellow</span><span class="demo-matrix-head">violet</span>
<span class="demo-matrix-label">light (default)</span><RayBadge>Info</RayBadge><RayBadge color="gray">Draft</RayBadge><RayBadge color="red">Failed</RayBadge><RayBadge color="green">Passed</RayBadge><RayBadge color="yellow">Pending</RayBadge><RayBadge color="violet">Beta</RayBadge>
<span class="demo-matrix-label">filled</span><RayBadge variant="filled">Info</RayBadge><RayBadge variant="filled" color="gray">Draft</RayBadge><RayBadge variant="filled" color="red">Failed</RayBadge><RayBadge variant="filled" color="green">Passed</RayBadge><RayBadge variant="filled" color="yellow">Pending</RayBadge><RayBadge variant="filled" color="violet">Beta</RayBadge>
<span class="demo-matrix-label">outline</span><RayBadge variant="outline">Info</RayBadge><RayBadge variant="outline" color="gray">Draft</RayBadge><RayBadge variant="outline" color="red">Failed</RayBadge><RayBadge variant="outline" color="green">Passed</RayBadge><RayBadge variant="outline" color="yellow">Pending</RayBadge><RayBadge variant="outline" color="violet">Beta</RayBadge>
<span class="demo-matrix-label">dot</span><RayBadge variant="dot">Info</RayBadge><RayBadge variant="dot" color="gray">Draft</RayBadge><RayBadge variant="dot" color="red">Failed</RayBadge><RayBadge variant="dot" color="green">Passed</RayBadge><RayBadge variant="dot" color="yellow">Pending</RayBadge><RayBadge variant="dot" color="violet">Beta</RayBadge>
<span class="demo-matrix-label">default</span><RayBadge variant="default">Neutral</RayBadge><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span>
<span class="demo-matrix-label">gradient</span><RayBadge variant="gradient">New</RayBadge><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span>
</div>
</div>
<p class="demo-muted" style="margin: 0">default is the neutral surface and ignores color; gradient takes <code>gradient="from to [deg]"</code>.</p>
<div class="demo-caption">Gradient</div>
<div class="demo-row">
<RayBadge variant="gradient">Theme</RayBadge>
<RayBadge variant="gradient" gradient="pink orange 90">pink → orange</RayBadge>
<RayBadge variant="gradient" gradient="teal blue 135">teal → blue</RayBadge>
</div>
<div class="demo-caption">Sizes</div>
<div class="demo-row">
<RayBadge size="xs">Extra small</RayBadge>
<RayBadge size="sm">Small</RayBadge>
<RayBadge size="md">Medium</RayBadge>
<RayBadge size="lg">Large</RayBadge>
<RayBadge size="xl">Extra large</RayBadge>
</div>
<div class="demo-caption">Radius and case</div>
<div class="demo-row">
<RayBadge variant="filled" color="gray" radius="xs">xs</RayBadge>
<RayBadge variant="filled" color="gray" radius="sm">sm</RayBadge>
<RayBadge variant="filled" color="gray" radius="md">md</RayBadge>
<RayBadge variant="filled" color="gray" radius="lg">lg</RayBadge>
<RayBadge variant="filled" color="gray">full (default)</RayBadge>
<RayBadge variant="outline" color="gray" normal-case>v1.27.37 · normal-case</RayBadge>
</div>
<div class="demo-caption">In context</div>
<ul class="demo-list" style="max-width: 32rem">
<li><span class="grow">ray-remote · build #412</span><RayBadge variant="dot" color="green">Online</RayBadge></li>
<li><span class="grow">rayauth · build #108</span><RayBadge variant="filled" color="red">Failed</RayBadge></li>
<li><span class="grow">ray-elements · release 0.5.0</span><RayBadge color="yellow">Pending</RayBadge></li>
</ul>
<div class="demo-row">
<RayButton variant="default">Inbox<RayBadge slot="right" size="xs" variant="filled" color="red">3</RayBadge></RayButton>
<RayButton variant="light">Releases<RayBadge slot="right" size="xs" color="gray" normal-case>v0.5</RayBadge></RayButton>
</div>
</template>