Tone separators
Five dividers that share one skeleton and differ only in semantic tone: info, success, warning, danger and a neutral muted. Each fades to transparent at both ends and carries a soft glow in its own tone. The base separator stays tone-free, so these live in the styled layer as separate components.
Installation
The styled layer is free and installs like any other ai2 component.
Run the following command
npx shadcn@latest add @ai2/separator-toneDependencies, the @ai2/tokens theme and the component file are installed together.
Copy the source
components/ui/separator-tone.tsx"use client"
import type * as React from "react"
import { cn } from "@/lib/utils"
/* Tone separator family: 5 decorative horizontal separators. The skeleton is the
same in every variant; the whole difference is the SEMANTIC TONE family: info,
success, warning, danger and the neutral muted. The line is a tone gradient
fading to transparent at both ends, with a soft glow of the same tone in the
middle. Color comes ONLY from tokens, via alpha color-mix. size controls the
thickness (sm..xl). Note: the BASE separator has no tone (the Axis Contract);
this is a separate component in the STYLED layer, so the base matrix stays clean.
No motion. */
export type StyledSize = "sm" | "md" | "lg" | "xl"
export type SeparatorTone = "info" | "success" | "warning" | "danger" | "muted"
type Props = React.ComponentProps<"div"> & { size?: StyledSize }
const thickness: Record<StyledSize, string> = {
sm: "h-px",
md: "h-0.5",
lg: "h-1",
xl: "h-1.5",
}
/* The gradient mid colour plus the glow shadow per tone. The classes are written statically, because Tailwind cannot see dynamically concatenated classes. */
const toneClass: Record<SeparatorTone, string> = {
info: "via-info shadow-[0_0_10px_-2px_color-mix(in_oklab,var(--color-info)_70%,transparent)]",
success:
"via-success shadow-[0_0_10px_-2px_color-mix(in_oklab,var(--color-success)_70%,transparent)]",
warning:
"via-warning shadow-[0_0_10px_-2px_color-mix(in_oklab,var(--color-warning)_70%,transparent)]",
danger:
"via-danger shadow-[0_0_10px_-2px_color-mix(in_oklab,var(--color-danger)_70%,transparent)]",
muted:
"via-[color-mix(in_oklab,var(--color-muted-foreground)_55%,transparent)]",
}
/* Shared shell: the only difference is the tone class and data-tone. */
function ToneRule({
tone,
className,
size = "md",
...props
}: Props & { tone: SeparatorTone }) {
return (
<div
data-slot="styled-separator"
data-tone={tone}
role="separator"
aria-orientation="horizontal"
className={cn(
"w-full rounded-full bg-gradient-to-r from-transparent to-transparent",
toneClass[tone],
thickness[size],
className
)}
{...props}
/>
)
}
/* Info: bilgi tonunda ayirac. */
export function InfoSeparator(props: Props) {
return <ToneRule tone="info" {...props} />
}
/* Success: basari tonunda ayirac. */
export function SuccessSeparator(props: Props) {
return <ToneRule tone="success" {...props} />
}
/* Warning: uyari tonunda ayirac. */
export function WarningSeparator(props: Props) {
return <ToneRule tone="warning" {...props} />
}
/* Danger: tehlike tonunda ayirac. */
export function DangerSeparator(props: Props) {
return <ToneRule tone="danger" {...props} />
}
/* Muted: notr, geri cekilmis ton. */
export function MutedSeparator(props: Props) {
return <ToneRule tone="muted" {...props} />
}Manual installs skip the @ai2/tokens theme, so add the token CSS from the theming guide or the tone colors will be missing.
Variations
5 takes on the same idea. Each is its own export, and every one accepts a size prop (sm, md, lg, xl) aligned to the base Button scale.
Info
A divider in the info tone.
import { InfoSeparator } from "@/components/ui/separator-tone"
<InfoSeparator />Success
A divider in the success tone.
import { SuccessSeparator } from "@/components/ui/separator-tone"
<SuccessSeparator />Warning
A divider in the warning tone.
import { WarningSeparator } from "@/components/ui/separator-tone"
<WarningSeparator />Danger
A divider in the danger tone.
import { DangerSeparator } from "@/components/ui/separator-tone"
<DangerSeparator />Muted
A neutral, receding divider.
import { MutedSeparator } from "@/components/ui/separator-tone"
<MutedSeparator />ai2 Tone separators: 5 styled variations on the token system
The ai2 Tone separators are a set of 5 decorative button variations from the styled layer of the @ai2 design system, built around dividers that carry a semantic tone. They are free and MIT licensed, and every color comes from a semantic token, so they theme with the rest of ai2 in light and dark.
Motion runs on framer-motion: none, every variation is static. The styled layer is opt-in, so the dependency only lands if you use it; the base components stay lean. Under reduced motion, nothing changes, there is no motion to reduce.
What is in the ai2 Tone separators?
5 exports in one file: Info, Success, Warning, Danger and Muted. Each renders a native button and takes a size prop (sm, md, lg, xl) aligned to the base Button. They are separate from the base Button on purpose: the base keeps its clean variant, tone and size axes, while the styled layer carries the effects.
You own the file. Copy the one category file and you have all 5 variations, with no runtime dependency on ai2 itself.
Why use it
- On-system by construction: Every color resolves to an ai2 semantic token, so the buttons follow your theme in light and dark with no extra work.
- Effect without the sprawl: The decorations live in a dedicated styled file, so the base Button keeps its clean, predictable API.
- Accessible and honest: Each renders a real button element, keeps a visible focus ring, and respects prefers-reduced-motion.
Features
- Token-driven color: No hardcoded hex or oklch; the look recolors with your theme tokens.
- framer-motion: none, every variation is static.
- Reduced-motion aware: Under prefers-reduced-motion, nothing changes, there is no motion to reduce.
- Size aligned to the base: Every variation takes sm, md, lg and xl matching the base Button height scale, so styled and base buttons line up in a row.
Production tips
- Use it for emphasis, not everywhere: Styled buttons draw the eye. Reserve them for the one action you want people to take on a screen, and use the base Button for the rest.
- Keep labels as verbs: The decoration adds weight, so a clear action label keeps the button scannable.
- Pick one variation per surface: The variations share a family; using two different ones in the same view competes for attention.
Works with the rest of ai2
The Tone separators sit alongside the base Button and the rest of the @ai2 registry. They share the same token file, so a styled action next to a base button or a badge stays visually consistent in both modes.