Message
One turn: the person's message, or the agent's reply with its actions.
Concept, not a real feature. Designed from Linear's comment bubbles and the ghost icon buttons from its issue toolbar. The timestamp sits after the actions in quaternary text.
import { Message } from "@replicas/ui";
import { useState } from "react";
const icon = (path: string) => (
<svg viewBox="0 0 16 16" fill="none" aria-hidden>
<path d={path} stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" />
</svg>
);
export default function MessageDemo() {
const [rating, setRating] = useState<"up" | "down">();
return (
<div style={{ display: "flex", flexDirection: "column", gap: 16, width: "100%", maxWidth: 480 }}>
<Message.Root from="user">
<Message.Content>How do I add a settings dialog?</Message.Content>
</Message.Root>
<Message.Root>
<Message.Content>
<p>Add a Dialog to the page, then open it from the gear button in the header. Keep the form inside the popup so focus stays in the dialog while it's open.</p>
</Message.Content>
<Message.Actions>
<Message.Action label="Copy">{icon("M5.5 5.5h7v7h-7zM10.5 3.5h-7v7")}</Message.Action>
<Message.Action label="Good response" pressed={rating === "up"} onClick={() => setRating(rating === "up" ? undefined : "up")}>
{icon("M5 7v6.5M5 7l2.5-4.5c.9 0 1.5.7 1.5 1.5V6h3a1 1 0 0 1 1 1.1l-.6 5.5a1 1 0 0 1-1 .9H5M5 7H3v6.5h2")}
</Message.Action>
<Message.Action label="Bad response" pressed={rating === "down"} onClick={() => setRating(rating === "down" ? undefined : "down")}>
{icon("M11 9V2.5M11 9l-2.5 4.5c-.9 0-1.5-.7-1.5-1.5V10H4a1 1 0 0 1-1-1.1l.6-5.5a1 1 0 0 1 1-.9H11M11 9h2V2.5h-2")}
</Message.Action>
<Message.Action label="Retry">{icon("M3 8a5 5 0 1 0 1.5-3.5M3 3v2.5h2.5")}</Message.Action>
<Message.Timestamp dateTime="2026-03-14T09:41">Just now</Message.Timestamp>
</Message.Actions>
</Message.Root>
</div>
);
}Prompt
Copy Prompt hands your agent everything it needs to build the Message in the Linear style: the measured tokens, the CSS and the structure.
Show Prompt
# Linear Message
One turn: the person's message, or the agent's reply with its actions.
Build a Message in this project that looks and behaves like Linear's. Measured from the running Linear app (linear.app). Keep every value exact. Map the tokens onto the project's own theme variables instead of hard-coding them. Use the project's own component library for behaviour, or Base UI primitives if it has none.
Fidelity: Concept, not a real feature. Designed from Linear's comment bubbles and the ghost icon buttons from its issue toolbar. The timestamp sits after the actions in quaternary text.
## Tokens
| Token | Light | Dark |
| --- | --- | --- |
| `--text-primary` | `lch(9.794% 0 282)` | `lch(100% 0 272)` |
| `--text-secondary` | `lch(19.588% 1.25 282)` | `lch(90.451% 1.2 272)` |
| `--text-quaternary` | `lch(64.64% 1.25 282)` | `lch(36.975% 1.2 272)` |
| `--accent` | `lch(53% 52.26 286.91)` | `lch(47.918% 59.303 288.421)` |
| `--ghost-bg-hover` | `lch(0% 0 0 / 0.06)` | `lch(10.149% 0.689 272)` |
| `--bubble-bg` | `lch(94.9% 0.5 282)` | `lch(12.6% 1.2 272)` |
| `--focus-ring` | `#5e69d1` | `#5e69d1` |
| `--font-size-mini` | `0.75rem` | `0.75rem` |
| `--font-size-regular` | `0.9375rem` | `0.9375rem` |
| `--font-weight-normal` | `450` | `450` |
| `--radius-rounded` | `9999px` | `9999px` |
| `--speed-highlight-fade-in` | `0s` | `0s` |
| `--speed-highlight-fade-out` | `0.15s` | `0.15s` |
## CSS
Scoped under `[data-style="linear"]`; dark rules sit under `[data-theme="dark"]`. The `ui-*` classes and data attributes match the structure below.
```css
[data-style="linear"] {
.ui-message {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
min-width: 0;
font-family: inherit;
}
.ui-message[data-from="user"] {
align-items: flex-end;
padding-left: 15%;
}
.ui-message-content {
display: flex;
flex-direction: column;
gap: 6px;
min-width: 0;
max-width: 100%;
color: var(--text-secondary);
font-size: var(--font-size-regular);
font-weight: var(--font-weight-normal);
line-height: 24px;
letter-spacing: -0.1px;
overflow-wrap: anywhere;
& p {
margin: 0;
}
& p + p {
margin-top: 6px;
}
}
.ui-message[data-from="user"] .ui-message-content {
box-sizing: border-box;
padding: 8px 14px;
border-radius: 10px;
background-color: var(--bubble-bg);
color: var(--text-primary);
}
.ui-message-actions {
display: flex;
align-items: center;
gap: 2px;
margin-left: -5px;
}
.ui-message-action {
box-sizing: border-box;
display: inline-flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
margin: 0;
padding: 0;
border: none;
border-radius: var(--radius-rounded);
background-color: transparent;
color: var(--text-quaternary);
cursor: default;
transition:
background-color var(--speed-highlight-fade-out),
color var(--speed-highlight-fade-out);
& svg {
width: 15px;
height: 15px;
}
@media (hover: hover) {
&:hover {
background-color: var(--ghost-bg-hover);
color: var(--text-secondary);
transition-duration: var(--speed-highlight-fade-in);
}
}
&:focus-visible {
outline: 1px solid var(--focus-ring);
outline-offset: 1px;
}
&[data-pressed] {
color: var(--accent);
}
}
.ui-message-timestamp {
margin-left: 6px;
color: var(--text-quaternary);
font-size: var(--font-size-mini);
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
}
```
## Structure
How Replicas assembles it on Base UI.
```tsx
import { Button as BaseButton } from "@base-ui/react/button";
import type { ComponentProps } from "react";
import { join } from "./utils";
type RootProps = ComponentProps<"div"> & {
from?: "user" | "assistant";
};
function Root({ className, from = "assistant", ...props }: RootProps) {
return <div className={join("ui-message", className)} data-from={from} {...props} />;
}
function Content({ className, ...props }: ComponentProps<"div">) {
return <div className={join("ui-message-content", className)} {...props} />;
}
function Actions({ className, ...props }: ComponentProps<"div">) {
return <div className={join("ui-message-actions", className)} {...props} />;
}
type ActionProps = Omit<BaseButton.Props, "className"> & {
className?: string;
label: string;
pressed?: boolean;
};
function Action({ className, label, pressed, ...props }: ActionProps) {
return (
<BaseButton
className={join("ui-message-action", className)}
aria-label={label}
aria-pressed={pressed}
data-pressed={pressed || undefined}
{...props}
/>
);
}
function Timestamp({ className, ...props }: ComponentProps<"time">) {
return <time className={join("ui-message-timestamp", className)} {...props} />;
}
export const Message = {
Root,
Content,
Actions,
Action,
Timestamp,
};
```
## Example
```tsx
import { Message } from "@replicas/ui";
import { useState } from "react";
const icon = (path: string) => (
<svg viewBox="0 0 16 16" fill="none" aria-hidden>
<path d={path} stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" />
</svg>
);
export default function MessageDemo() {
const [rating, setRating] = useState<"up" | "down">();
return (
<div style={{ display: "flex", flexDirection: "column", gap: 16, width: "100%", maxWidth: 480 }}>
<Message.Root from="user">
<Message.Content>How do I add a settings dialog?</Message.Content>
</Message.Root>
<Message.Root>
<Message.Content>
<p>Add a Dialog to the page, then open it from the gear button in the header. Keep the form inside the popup so focus stays in the dialog while it's open.</p>
</Message.Content>
<Message.Actions>
<Message.Action label="Copy">{icon("M5.5 5.5h7v7h-7zM10.5 3.5h-7v7")}</Message.Action>
<Message.Action label="Good response" pressed={rating === "up"} onClick={() => setRating(rating === "up" ? undefined : "up")}>
{icon("M5 7v6.5M5 7l2.5-4.5c.9 0 1.5.7 1.5 1.5V6h3a1 1 0 0 1 1 1.1l-.6 5.5a1 1 0 0 1-1 .9H5M5 7H3v6.5h2")}
</Message.Action>
<Message.Action label="Bad response" pressed={rating === "down"} onClick={() => setRating(rating === "down" ? undefined : "down")}>
{icon("M11 9V2.5M11 9l-2.5 4.5c-.9 0-1.5-.7-1.5-1.5V10H4a1 1 0 0 1-1-1.1l.6-5.5a1 1 0 0 1 1-.9H11M11 9h2V2.5h-2")}
</Message.Action>
<Message.Action label="Retry">{icon("M3 8a5 5 0 1 0 1.5-3.5M3 3v2.5h2.5")}</Message.Action>
<Message.Timestamp dateTime="2026-03-14T09:41">Just now</Message.Timestamp>
</Message.Actions>
</Message.Root>
</div>
);
}
```
## Foundations
The rest of the Linear style, as a skill: https://replicas.raphaelsalaja.com/skills/linear/SKILL.md