Task
The steps an agent takes, as it takes them.
Concept, not a real feature. Designed from Linear's card surface, its activity rows and the inline code chip.
import { Task } from "@replicas/ui";
const search = (
<svg viewBox="0 0 16 16" fill="none">
<circle cx="7" cy="7" r="4.25" stroke="currentColor" strokeWidth="1.5" />
<path d="M10.25 10.25L13 13" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
</svg>
);
const file = (
<svg viewBox="0 0 16 16" fill="none">
<path d="M4 2.5h5l3 3v8H4zM9 2.5v3h3" stroke="currentColor" strokeWidth="1.25" strokeLinejoin="round" />
</svg>
);
export default function TaskDemo() {
return (
<Task.Root defaultOpen style={{ width: "100%", maxWidth: 420 }}>
<Task.Trigger description="3 steps">Found the project files</Task.Trigger>
<Task.Content>
<Task.Item icon={search}>Searched for page components</Task.Item>
<Task.Item icon={file}>
Read <Task.File>app/page.tsx</Task.File>
</Task.Item>
<Task.Item icon={file}>
Read <Task.File>app/layout.tsx</Task.File>
</Task.Item>
</Task.Content>
</Task.Root>
);
}Prompt
Copy Prompt hands your agent everything it needs to build the Task in the Linear style: the measured tokens, the CSS and the structure.
Show Prompt
# Linear Task
The steps an agent takes, as it takes them.
Build a Task 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 card surface, its activity rows and the inline code chip.
## Tokens
| Token | Light | Dark |
| --- | --- | --- |
| `--border-primary` | `lch(95.24% 0 282)` | `lch(9.84% 1.48 272)` |
| `--border-secondary` | `lch(88.49% 0 282)` | `lch(14.16% 1.48 272)` |
| `--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-tertiary` | `lch(39.176% 1.25 282)` | `lch(61.803% 1.2 272)` |
| `--text-quaternary` | `lch(64.64% 1.25 282)` | `lch(36.975% 1.2 272)` |
| `--danger-text` | `lch(50% 80 29)` | `lch(80% 80 29)` |
| `--card-bg` | `lch(100% 0 282)` | `lch(9.345% 0.85 272)` |
| `--card-ring` | `lch(0% 0 0 / 0.088)` | `lch(100% 0 0 / 0.083)` |
| `--fill-subtle` | `lch(0% 0 0 / 0.032)` | `lch(100% 0 0 / 0.035)` |
| `--code-bg` | `lch(96.2% 0.5 282)` | `lch(7.9% 0.85 272)` |
| `--code-border` | `lch(89.5% 0 282)` | `lch(16.32% 1.48 272)` |
| `--shadow-low` | `lch(0% 0 0 / 0.02) 0 3px 6px -2px, lch(0% 0 0 / 0.04) 0 1px 1px 0` | `lch(0% 0 0 / 0.3) 0 0.5px 1px 1px` |
| `--focus-ring` | `#5e69d1` | `#5e69d1` |
| `--font-monospace` | `"Berkeley Mono", "SFMono Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace` | `"Berkeley Mono", "SFMono Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace` |
| `--font-size-mini` | `0.75rem` | `0.75rem` |
| `--font-size-small` | `0.8125rem` | `0.8125rem` |
| `--font-weight-medium` | `500` | `500` |
| `--radius-kbd` | `4px` | `4px` |
| `--speed-highlight-fade-in` | `0s` | `0s` |
| `--speed-quick` | `0.1s` | `0.1s` |
| `--speed-highlight-fade-out` | `0.15s` | `0.15s` |
| `--ease-spring-collapse` | `linear(0, 0.0183, 0.0632, 0.1233, 0.191, 0.2611, 0.3304, 0.3969, 0.4593, 0.517, 0.5698, 0.6177, 0.6608, 0.6996, 0.7342, 0.7651, 0.7925, 0.8169, 0.8384, 0.8575, 0.8744, 0.8893, 0.9025, 0.9141, 0.9243, 0.9333, 0.9413, 0.9483, 0.9545, 0.9599, 0.9647, 0.9689, 0.9726, 0.9759, 0.9788, 0.9813, 0.9836, 0.9855, 0.9873, 0.9888, 1)` | `linear(0, 0.0183, 0.0632, 0.1233, 0.191, 0.2611, 0.3304, 0.3969, 0.4593, 0.517, 0.5698, 0.6177, 0.6608, 0.6996, 0.7342, 0.7651, 0.7925, 0.8169, 0.8384, 0.8575, 0.8744, 0.8893, 0.9025, 0.9141, 0.9243, 0.9333, 0.9413, 0.9483, 0.9545, 0.9599, 0.9647, 0.9689, 0.9726, 0.9759, 0.9788, 0.9813, 0.9836, 0.9855, 0.9873, 0.9888, 1)` |
| `--duration-spring-collapse` | `185ms` | `185ms` |
## CSS
Scoped under `[data-style="linear"]`; dark rules sit under `[data-theme="dark"]`. The `ui-*` classes and data attributes match the structure below.
```css
@keyframes linear-task-shimmer {
from {
background-position: 100% 0;
}
to {
background-position: 0 0;
}
}
[data-style="linear"] {
.ui-task {
box-sizing: border-box;
display: flex;
flex-direction: column;
min-width: 0;
overflow: hidden;
border-radius: 10px;
background-color: var(--card-bg);
box-shadow:
0 0 0 0.5px var(--card-ring),
var(--shadow-low);
color: var(--text-tertiary);
font-family: inherit;
font-size: var(--font-size-small);
line-height: 20px;
}
.ui-task-trigger {
box-sizing: border-box;
display: flex;
align-items: center;
gap: 8px;
width: 100%;
height: 40px;
margin: 0;
padding: 0 14px;
border: none;
background-color: transparent;
color: var(--text-tertiary);
font: inherit;
text-align: start;
user-select: none;
cursor: default;
transition: background-color var(--speed-highlight-fade-out);
@media (hover: hover) {
&:hover {
background-color: var(--fill-subtle);
transition-duration: var(--speed-highlight-fade-in);
}
}
&:focus-visible {
outline: 1px solid var(--focus-ring);
outline-offset: -1px;
}
}
.ui-task-icon {
display: flex;
flex-shrink: 0;
color: var(--text-tertiary);
& svg,
& .ui-spinner {
width: 14px;
height: 14px;
}
}
.ui-task-title {
min-width: 0;
overflow: hidden;
color: var(--text-primary);
font-weight: var(--font-weight-medium);
text-overflow: ellipsis;
white-space: nowrap;
}
.ui-task-description {
flex-shrink: 0;
color: var(--text-tertiary);
font-variant-numeric: tabular-nums;
}
.ui-task-chevron {
width: 8px;
height: 8px;
flex-shrink: 0;
margin-left: auto;
background-color: var(--text-quaternary);
clip-path: polygon(25% 12%, 85% 50%, 25% 88%);
transition: transform var(--speed-quick) ease-in-out;
& path {
display: none;
}
[data-panel-open] > & {
transform: rotate(90deg);
}
}
.ui-task[data-status="running"] .ui-task-title {
background: linear-gradient(
90deg,
var(--text-primary) 0 40%,
var(--text-quaternary) 50%,
var(--text-primary) 60% 100%
)
0 0 / 250% 100%;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
animation: linear-task-shimmer 2.4s linear infinite;
}
.ui-task[data-status="error"] :is(.ui-task-icon, .ui-task-title) {
color: var(--danger-text);
}
.ui-task-content {
box-sizing: border-box;
display: flex;
flex-direction: column;
height: var(--collapsible-panel-height);
overflow: hidden;
border-top: 0.5px solid var(--border-secondary);
transition: height var(--duration-spring-collapse) var(--ease-spring-collapse);
&[data-starting-style],
&[data-ending-style] {
height: 0;
}
}
.ui-task-item {
display: flex;
flex-shrink: 0;
align-items: center;
gap: 8px;
min-width: 0;
min-height: 36px;
padding: 0 14px;
box-sizing: border-box;
color: var(--text-tertiary);
& + & {
border-top: 0.5px solid var(--border-primary);
}
}
.ui-task-item-icon {
display: flex;
flex-shrink: 0;
color: var(--text-quaternary);
& svg,
& .ui-spinner {
width: 14px;
height: 14px;
}
}
.ui-task-item-label {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ui-task-item[data-status="running"] .ui-task-item-label {
color: var(--text-secondary);
}
.ui-task-file {
box-sizing: border-box;
display: inline-flex;
align-items: center;
height: 20px;
margin: 0 1px;
padding: 0 5px;
border-radius: var(--radius-kbd);
background-color: var(--code-bg);
box-shadow: inset 0 0 0 0.5px var(--code-border);
color: var(--text-secondary);
font-family: var(--font-monospace);
font-size: var(--font-size-mini);
line-height: 1;
vertical-align: 1px;
}
@media (prefers-reduced-motion: reduce) {
.ui-task[data-status="running"] .ui-task-title {
background: none;
color: var(--text-primary);
animation: none;
}
.ui-task-chevron,
.ui-task-content {
transition: none;
}
}
}
```
## Structure
How Replicas assembles it on Base UI.
```tsx
import { Collapsible as BaseCollapsible } from "@base-ui/react/collapsible";
import type { ComponentProps, ReactNode } from "react";
import { join } from "./utils";
type RootProps = Omit<BaseCollapsible.Root.Props, "className"> & {
className?: string;
status?: string;
};
function Root({ className, status, ...props }: RootProps) {
return <BaseCollapsible.Root className={join("ui-task", className)} data-status={status} {...props} />;
}
type TriggerProps = Omit<BaseCollapsible.Trigger.Props, "className"> & {
className?: string;
icon?: ReactNode;
description?: ReactNode;
};
function Trigger({ className, icon, description, children, ...props }: TriggerProps) {
return (
<BaseCollapsible.Trigger className={join("ui-task-trigger", className)} {...props}>
{icon ? <span className="ui-task-icon" aria-hidden>{icon}</span> : null}
<span className="ui-task-title">{children}</span>
{description ? <span className="ui-task-description">{description}</span> : null}
<svg className="ui-task-chevron" viewBox="0 0 16 16" fill="none" aria-hidden>
<path d="M6 4l4 4-4 4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
</svg>
</BaseCollapsible.Trigger>
);
}
function Content({ className, ...props }: Omit<BaseCollapsible.Panel.Props, "className"> & { className?: string }) {
return <BaseCollapsible.Panel className={join("ui-task-content", className)} {...props} />;
}
type ItemProps = ComponentProps<"div"> & { icon?: ReactNode; status?: string };
function Item({ className, icon, status, children, ...props }: ItemProps) {
return (
<div className={join("ui-task-item", className)} data-status={status} {...props}>
{icon ? <span className="ui-task-item-icon" aria-hidden>{icon}</span> : null}
<span className="ui-task-item-label">{children}</span>
</div>
);
}
function File({ className, ...props }: ComponentProps<"span">) {
return <span className={join("ui-task-file", className)} {...props} />;
}
export const Task = {
Root,
Trigger,
Content,
Item,
File,
};
```
## Example
```tsx
import { Task } from "@replicas/ui";
const search = (
<svg viewBox="0 0 16 16" fill="none">
<circle cx="7" cy="7" r="4.25" stroke="currentColor" strokeWidth="1.5" />
<path d="M10.25 10.25L13 13" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
</svg>
);
const file = (
<svg viewBox="0 0 16 16" fill="none">
<path d="M4 2.5h5l3 3v8H4zM9 2.5v3h3" stroke="currentColor" strokeWidth="1.25" strokeLinejoin="round" />
</svg>
);
export default function TaskDemo() {
return (
<Task.Root defaultOpen style={{ width: "100%", maxWidth: 420 }}>
<Task.Trigger description="3 steps">Found the project files</Task.Trigger>
<Task.Content>
<Task.Item icon={search}>Searched for page components</Task.Item>
<Task.Item icon={file}>
Read <Task.File>app/page.tsx</Task.File>
</Task.Item>
<Task.Item icon={file}>
Read <Task.File>app/layout.tsx</Task.File>
</Task.Item>
</Task.Content>
</Task.Root>
);
}
```
## Foundations
The rest of the Linear style, as a skill: https://replicas.raphaelsalaja.com/skills/linear/SKILL.md