<div class="demo-caption">Variants × colors</div>
<div class="demo-scroll">
<div class="demo-matrix" style="--demo-cols: 4" id="demo-raised">
<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">teal</span>
<span class="demo-matrix-label">filled</span><ray-button>Button</ray-button><ray-button color="gray">Button</ray-button><ray-button color="red">Button</ray-button><ray-button color="teal">Button</ray-button>
<span class="demo-matrix-label">light</span><ray-button variant="light">Button</ray-button><ray-button variant="light" color="gray">Button</ray-button><ray-button variant="light" color="red">Button</ray-button><ray-button variant="light" color="teal">Button</ray-button>
<span class="demo-matrix-label">outline</span><ray-button variant="outline">Button</ray-button><ray-button variant="outline" color="gray">Button</ray-button><ray-button variant="outline" color="red">Button</ray-button><ray-button variant="outline" color="teal">Button</ray-button>
<span class="demo-matrix-label">subtle</span><ray-button variant="subtle">Button</ray-button><ray-button variant="subtle" color="gray">Button</ray-button><ray-button variant="subtle" color="red">Button</ray-button><ray-button variant="subtle" color="teal">Button</ray-button>
<span class="demo-matrix-label">default</span><ray-button variant="default">Button</ray-button><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span>
<span class="demo-matrix-label">transparent</span><ray-button variant="transparent">Button</ray-button><ray-button variant="transparent" color="gray">Button</ray-button><ray-button variant="transparent" color="red">Button</ray-button><ray-button variant="transparent" color="teal">Button</ray-button>
<span class="demo-matrix-label">raised</span><ray-button variant="raised">Button</ray-button><ray-button variant="raised" color="gray">Button</ray-button><ray-button variant="raised" color="red">Button</ray-button><ray-button variant="raised" color="teal">Button</ray-button>
</div>
</div>
<p class="demo-muted" style="margin: 0">default is the neutral surface and ignores color. Any palette name or CSS color works: <code>color="#8e44ad"</code>.</p>
<div class="demo-caption">Gradient</div>
<div class="demo-row">
<ray-button variant="gradient">Theme gradient</ray-button>
<ray-button variant="gradient" gradient="pink orange 90">pink → orange</ray-button>
<ray-button variant="gradient" gradient="#0f766e #1d4ed8 135">Raw colors</ray-button>
</div>
<div class="demo-caption">Sizes</div>
<div class="demo-row">
<ray-button size="xs">Extra small</ray-button>
<ray-button size="sm">Small</ray-button>
<ray-button size="md">Medium</ray-button>
<ray-button size="lg">Large</ray-button>
<ray-button size="xl">Extra large</ray-button>
</div>
<div class="demo-caption">Radius</div>
<div class="demo-row">
<ray-button variant="light" radius="xs">xs</ray-button>
<ray-button variant="light" radius="sm">sm</ray-button>
<ray-button variant="light" radius="md">md</ray-button>
<ray-button variant="light" radius="lg">lg</ray-button>
<ray-button variant="light" radius="full">full</ray-button>
</div>
<div class="demo-caption">Icons, states and links</div>
<div class="demo-row">
<ray-button variant="default"><ray-icon slot="left" name="plus"></ray-icon>New file</ray-button>
<ray-button>Continue<ray-icon slot="right" name="chevron-right"></ray-icon></ray-button>
<ray-icon-button variant="light" label="Settings"><ray-icon name="settings"></ray-icon></ray-icon-button>
<ray-button loading>Saving</ray-button>
<ray-button disabled>Disabled</ray-button>
<ray-button href="#button" variant="subtle">Link<ray-icon slot="right" name="arrow-up-right"></ray-icon></ray-button>
</div>
<ray-button full-width variant="raised" color="teal">Full width</ray-button>
<div class="demo-caption">Long labels in narrow containers: drag the corner of the box</div>
<div class="demo-resize demo-stack">
<ray-button full-width variant="default">Another schedule (e.g. a different dose at weekends)</ray-button>
<ray-button full-width variant="light" wrap>Another schedule (e.g. a different dose at weekends)</ray-button>
</div>
<p class="demo-muted">A label longer than the room ends in an ellipsis; with <code>wrap</code> it breaks into lines.</p>
import type { CSSProperties } from "react";
import { RayButton, RayIcon, RayIconButton } from "@raylang/react";
export function ButtonExample() {
return (
<>
<div className="demo-caption">Variants × colors</div>
<div className="demo-scroll">
<div className="demo-matrix" style={{ "--demo-cols": "4" } as CSSProperties} id="demo-raised">
<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">teal</span>
<span className="demo-matrix-label">filled</span><RayButton>Button</RayButton><RayButton color="gray">Button</RayButton><RayButton color="red">Button</RayButton><RayButton color="teal">Button</RayButton>
<span className="demo-matrix-label">light</span><RayButton variant="light">Button</RayButton><RayButton variant="light" color="gray">Button</RayButton><RayButton variant="light" color="red">Button</RayButton><RayButton variant="light" color="teal">Button</RayButton>
<span className="demo-matrix-label">outline</span><RayButton variant="outline">Button</RayButton><RayButton variant="outline" color="gray">Button</RayButton><RayButton variant="outline" color="red">Button</RayButton><RayButton variant="outline" color="teal">Button</RayButton>
<span className="demo-matrix-label">subtle</span><RayButton variant="subtle">Button</RayButton><RayButton variant="subtle" color="gray">Button</RayButton><RayButton variant="subtle" color="red">Button</RayButton><RayButton variant="subtle" color="teal">Button</RayButton>
<span className="demo-matrix-label">default</span><RayButton variant="default">Button</RayButton><span className="demo-muted">—</span><span className="demo-muted">—</span><span className="demo-muted">—</span>
<span className="demo-matrix-label">transparent</span><RayButton variant="transparent">Button</RayButton><RayButton variant="transparent" color="gray">Button</RayButton><RayButton variant="transparent" color="red">Button</RayButton><RayButton variant="transparent" color="teal">Button</RayButton>
<span className="demo-matrix-label">raised</span><RayButton variant="raised">Button</RayButton><RayButton variant="raised" color="gray">Button</RayButton><RayButton variant="raised" color="red">Button</RayButton><RayButton variant="raised" color="teal">Button</RayButton>
</div>
</div>
<p className="demo-muted" style={{ margin: "0" }}>default is the neutral surface and ignores color. Any palette name or CSS color works: <code>color="#8e44ad"</code>.</p>
<div className="demo-caption">Gradient</div>
<div className="demo-row">
<RayButton variant="gradient">Theme gradient</RayButton>
<RayButton variant="gradient" gradient="pink orange 90">pink → orange</RayButton>
<RayButton variant="gradient" gradient="#0f766e #1d4ed8 135">Raw colors</RayButton>
</div>
<div className="demo-caption">Sizes</div>
<div className="demo-row">
<RayButton size="xs">Extra small</RayButton>
<RayButton size="sm">Small</RayButton>
<RayButton size="md">Medium</RayButton>
<RayButton size="lg">Large</RayButton>
<RayButton size="xl">Extra large</RayButton>
</div>
<div className="demo-caption">Radius</div>
<div className="demo-row">
<RayButton variant="light" radius="xs">xs</RayButton>
<RayButton variant="light" radius="sm">sm</RayButton>
<RayButton variant="light" radius="md">md</RayButton>
<RayButton variant="light" radius="lg">lg</RayButton>
<RayButton variant="light" radius="full">full</RayButton>
</div>
<div className="demo-caption">Icons, states and links</div>
<div className="demo-row">
<RayButton variant="default"><RayIcon slot="left" name="plus" />New file</RayButton>
<RayButton>Continue<RayIcon slot="right" name="chevron-right" /></RayButton>
<RayIconButton variant="light" label="Settings"><RayIcon name="settings" /></RayIconButton>
<RayButton loading>Saving</RayButton>
<RayButton disabled>Disabled</RayButton>
<RayButton href="#button" variant="subtle">Link<RayIcon slot="right" name="arrow-up-right" /></RayButton>
</div>
<RayButton fullWidth variant="raised" color="teal">Full width</RayButton>
<div className="demo-caption">Long labels in narrow containers: drag the corner of the box</div>
<div className="demo-resize demo-stack">
<RayButton fullWidth variant="default">Another schedule (e.g. a different dose at weekends)</RayButton>
<RayButton fullWidth variant="light" wrap>Another schedule (e.g. a different dose at weekends)</RayButton>
</div>
<p className="demo-muted">A label longer than the room ends in an ellipsis; with <code>wrap</code> it breaks into lines.</p>
</>
);
}
<template>
<div class="demo-caption">Variants × colors</div>
<div class="demo-scroll">
<div class="demo-matrix" style="--demo-cols: 4" id="demo-raised">
<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">teal</span>
<span class="demo-matrix-label">filled</span><RayButton>Button</RayButton><RayButton color="gray">Button</RayButton><RayButton color="red">Button</RayButton><RayButton color="teal">Button</RayButton>
<span class="demo-matrix-label">light</span><RayButton variant="light">Button</RayButton><RayButton variant="light" color="gray">Button</RayButton><RayButton variant="light" color="red">Button</RayButton><RayButton variant="light" color="teal">Button</RayButton>
<span class="demo-matrix-label">outline</span><RayButton variant="outline">Button</RayButton><RayButton variant="outline" color="gray">Button</RayButton><RayButton variant="outline" color="red">Button</RayButton><RayButton variant="outline" color="teal">Button</RayButton>
<span class="demo-matrix-label">subtle</span><RayButton variant="subtle">Button</RayButton><RayButton variant="subtle" color="gray">Button</RayButton><RayButton variant="subtle" color="red">Button</RayButton><RayButton variant="subtle" color="teal">Button</RayButton>
<span class="demo-matrix-label">default</span><RayButton variant="default">Button</RayButton><span class="demo-muted">—</span><span class="demo-muted">—</span><span class="demo-muted">—</span>
<span class="demo-matrix-label">transparent</span><RayButton variant="transparent">Button</RayButton><RayButton variant="transparent" color="gray">Button</RayButton><RayButton variant="transparent" color="red">Button</RayButton><RayButton variant="transparent" color="teal">Button</RayButton>
<span class="demo-matrix-label">raised</span><RayButton variant="raised">Button</RayButton><RayButton variant="raised" color="gray">Button</RayButton><RayButton variant="raised" color="red">Button</RayButton><RayButton variant="raised" color="teal">Button</RayButton>
</div>
</div>
<p class="demo-muted" style="margin: 0">default is the neutral surface and ignores color. Any palette name or CSS color works: <code>color="#8e44ad"</code>.</p>
<div class="demo-caption">Gradient</div>
<div class="demo-row">
<RayButton variant="gradient">Theme gradient</RayButton>
<RayButton variant="gradient" gradient="pink orange 90">pink → orange</RayButton>
<RayButton variant="gradient" gradient="#0f766e #1d4ed8 135">Raw colors</RayButton>
</div>
<div class="demo-caption">Sizes</div>
<div class="demo-row">
<RayButton size="xs">Extra small</RayButton>
<RayButton size="sm">Small</RayButton>
<RayButton size="md">Medium</RayButton>
<RayButton size="lg">Large</RayButton>
<RayButton size="xl">Extra large</RayButton>
</div>
<div class="demo-caption">Radius</div>
<div class="demo-row">
<RayButton variant="light" radius="xs">xs</RayButton>
<RayButton variant="light" radius="sm">sm</RayButton>
<RayButton variant="light" radius="md">md</RayButton>
<RayButton variant="light" radius="lg">lg</RayButton>
<RayButton variant="light" radius="full">full</RayButton>
</div>
<div class="demo-caption">Icons, states and links</div>
<div class="demo-row">
<RayButton variant="default"><RayIcon slot="left" name="plus" />New file</RayButton>
<RayButton>Continue<RayIcon slot="right" name="chevron-right" /></RayButton>
<RayIconButton variant="light" label="Settings"><RayIcon name="settings" /></RayIconButton>
<RayButton loading>Saving</RayButton>
<RayButton disabled>Disabled</RayButton>
<RayButton href="#button" variant="subtle">Link<RayIcon slot="right" name="arrow-up-right" /></RayButton>
</div>
<RayButton full-width variant="raised" color="teal">Full width</RayButton>
<div class="demo-caption">Long labels in narrow containers: drag the corner of the box</div>
<div class="demo-resize demo-stack">
<RayButton full-width variant="default">Another schedule (e.g. a different dose at weekends)</RayButton>
<RayButton full-width variant="light" wrap>Another schedule (e.g. a different dose at weekends)</RayButton>
</div>
<p class="demo-muted">A label longer than the room ends in an ellipsis; with <code>wrap</code> it breaks into lines.</p>
</template>