InlineAlert
Una línea de estado con su icono, sin caja, justo al lado de la cosa de la que habla.
import { Alert } from '@sypnia/ui/react'
Junto a un campo
Una advertencia y una confirmación, cada una debajo del campo al que se refiere.
This key expires in 3 days.
storefront.sypnia.app is free.
Código
import { Alert, Field, FormGrid, Input } from '@sypnia/ui/react';
// One line, right where it applies. It takes no box and no extra height.
export default function InAForm() {
return (
<FormGrid>
<div className="sy-stack">
<Field label="Key name"><Input defaultValue="Back office" /></Field>
<Alert inline tone="warn">This key expires in 3 days.</Alert>
</div>
<div className="sy-stack">
<Field label="Project address"><Input machine defaultValue="storefront" /></Field>
<Alert inline tone="ok">storefront.sypnia.app is free.</Alert>
</div>
</FormGrid>
);
} Tonos
Información, éxito, advertencia y falla.
Changes apply to new requests only.
All 5 tables are backed up.
2 members have not accepted their invitation.
The last backup failed. The one from yesterday is safe.
Código
import { Alert } from '@sypnia/ui/react';
export default function Tones() {
return (
<div className="sy-stack">
<Alert inline tone="info">Changes apply to new requests only.</Alert>
<Alert inline tone="ok">All 5 tables are backed up.</Alert>
<Alert inline tone="warn">2 members have not accepted their invitation.</Alert>
<Alert inline tone="fail">The last backup failed. The one from yesterday is safe.</Alert>
</div>
);
} En el pie de un panel
La línea y el botón que va con ella.
Webhooks
Sypnia calls your server when an order is created or paid.
Código
import { Alert, Button, Panel } from '@sypnia/ui/react';
export default function InARow() {
return (
<Panel title="Webhooks" footer={<><Alert inline tone="fail">3 deliveries failed in the last hour.</Alert><Button size="sm">See deliveries</Button></>}>
<p className="sy-text--sm sy-text--soft">Sypnia calls your server when an order is created or paid.</p>
</Panel>
);
} Cuándo usarlo
Úsalo cuando
- Un dato corto sobre un campo, una fila o un panel: «Esta clave vence en 3 días».
- El mensaje no debe mover el diseño: es una línea de texto pequeño.
No lo uses cuando
- Necesita un título, un botón o más de una frase: usa la Alert con caja.
- Es el error de un campo: pásalo como
erroral Field, que lo une al control. - Solo muestra un estado («Activo», «Pagado»): eso es un Badge o un Status.
Para todos
- El mismo anuncio que Alert:
failywarninterrumpen, los demás esperan. - El icono repite el tono, así se lee sin color.
- El texto es pequeño pero en negrita, y mantiene contraste AA en noche y papel.
Props
| Alert | Tipo | Por defecto |
|---|---|---|
actionsButtons that solve it («Try again», «Upgrade»). | ReactNode | |
className | string | |
icon | "function" | "error" | "replay" | "performance" | "uptime" | "traces" | "rage-click" | "dead-click" | "alert" | "summary" | "watch" | "sleep" | "light" | "suggestion" | "prompt" | "mcp" | "pull-request" | "git-branch" | "fix" | "check" | "open-source" | "self-host" | "sdk" | "engine" | "signals-in" | "web" | "mobile" | "backend" | "cloud" | "data" | "user" | "clock" | "shield" | "lock" | "mail" | "star" | "copy" | "arrow-right" | "arrow-up-right" | "chevron-down" | "plus" | "close" | "play" | "pause" | "search" | "info" | "warning" | "trash" | "menu" | "download" | "upload" | "filter" | "home" | "table" | "key" | "users" | "sun" | "moon" | "globe" | "sign-out" | "link" | "edit" | "calendar" | "chevron-left" | "chevron-right" | "chevron-up" | "minus" | "more" | "sort" | "arrow-left" | "arrow-up" | "arrow-down" | "arrow-down-right" | "arrow-down-left" | "arrow-up-left" | "swap" | "swap-vertical" | "chevrons-up-down" | "chevrons-left" | "chevrons-right" | "chevrons-down" | "chevrons-up" | "enter" | "undo" | "redo" | "refresh" | "expand" | "collapse" | "fullscreen" | "fullscreen-exit" | "move" | "grip" | "more-vertical" | "trend-up" | "trend-down" | "log-in" | "external" | "slash" | "equal" | "check-small" | "close-small" | "success" | "failure" | "help" | "plus-circle" | "minus-circle" | "ban" | "pending" | "dot" | "dot-off" | "bolt" | "flag" | "pin" | "bookmark" | "heart" | "thumbs-up" | "thumbs-down" | "sparkle" | "target" | "idea" | "award" | "crown" | "bell" | "bell-off" | "bug" | "fire" | "leaf" | "file" | "file-text" | "file-code" | "file-plus" | "file-check" | "file-table" | "file-lock" | "files" | "folder" | "folder-open" | "folder-plus" | "archive" | "clipboard" | "clipboard-check" | "paperclip" | "image" | "save" | "cloud-upload" | "cloud-download" | "cloud-off" | "import" | "export" | "share" | "inbox" | "send" | "box" | "layers" | "tag" | "hash" | "at" | "qr-code" | "book" | "book-open" | "notebook" | "rows" | "columns" | "grid" | "list" | "list-ordered" | "list-checks" | "kanban" | "chart-line" | "chart-bar" | "chart-area" | "chart-parts" | "chart-scatter" | "gauge" | "funnel" | "heatmap" | "sparkline" | "percent" | "sum" | "variable" | "braces" | "brackets" | "null" | "primary-key" | "relation" | "index" | "query" | "backup" | "migrate" | "seed" | "csv" | "json" | "bold" | "italic" | "underline" | "strikethrough" | "heading" | "text" | "paragraph" | "quote" | "code" | "align-left" | "align-center" | "align-right" | "indent" | "outdent" | "unlink" | "scissors" | "eraser" | "highlight" | "duplicate" | "paste" | "wand" | "palette" | "brush" | "ruler" | "crop" | "user-plus" | "user-minus" | "user-check" | "user-x" | "user-circle" | "team" | "organization" | "id-card" | "contact" | "role" | "chat" | "chats" | "comment" | "phone" | "video" | "mic" | "mic-off" | "megaphone" | "rss" | "mail-open" | "handshake" | "wave" | "desktop" | "laptop" | "tablet" | "terminal" | "window" | "browser" | "server" | "cpu" | "memory" | "disk" | "network" | "wifi" | "wifi-off" | "plug" | "power" | "container" | "queue" | "cron" | "webhook" | "api" | "route" | "load-balancer" | "dns" | "domain" | "certificate" | "firewall" | "rocket" | "deploy" | "rollback" | "logs" | "test" | "pipeline" | "commit" | "merge" | "fork" | "release" | "environment" | "region" | "robot" | "agent" | "puzzle" | "credit-card" | "wallet" | "receipt" | "invoice" | "cart" | "bag" | "coins" | "dollar" | "gift" | "plan" | "upgrade" | "usage" | "bank" | "history" | "timer" | "hourglass" | "calendar-check" | "calendar-plus" | "map" | "compass" | "translate" | "accessibility" | "keyboard" | "pointer" | "hand" | "print" | "support" | "stop" | "record" | "skip-forward" | "skip-back" | "fast-forward" | "rewind" | "volume" | "mute" | "camera" | "zoom-in" | "zoom-out" | "eye-off" | "sliders" | "settings" | "toggle" | "sidebar-left" | "sidebar-right" | "panel-bottom" | "split" | "layout" | "dashboard" | "cards" | "density" | "dark-mode" | "theme" | "mouse" | "cursor" | "select" | "picture-in-picture" | "scan" | "unlock" | "shield-off" | "shield-alert" | "shield-user" | "password" | "fingerprint" | "two-factor" | "policy" | "incognito" | "verified" | "audit" | "secret" | "p-telemetry" | "p-cases" | "p-agent" | "p-git" | "p-data" | "p-files" | "p-run" | "p-ai" | "p-mail" | "p-domains" | "p-design" | "p-learn" | "p-skills" | "p-app" | "p-ui" | |
inlineOne line inside a form or a row, without a box. | boolean | |
onDismissShows a close button. Only for messages the person can ignore. | (() => void) | |
title | ReactNode | |
toneHow serious it is. Every tone has its own icon: colour is never the only sign. | "info" | "ok" | "warn" | "fail" | "neutral" | info |