ErrorCard playground
Present a recoverable error with a title, optional code, details and caller-supplied actions.
Preview
Upload interrupted
E_UPLOADReconnect to resume the upload.
Props editor
State matrix
| Variant | Default |
|---|---|
| danger | Upload interrupted E_UPLOADReconnect to resume the upload. |
| warning | Upload interrupted E_UPLOADReconnect to resume the upload. |
| info | Upload interrupted E_UPLOADReconnect to resume the upload. |
Published example
API reference'use client'
import { useState } from 'react'
import { Button, ErrorCard } from '@ancrel/ui'
import '@ancrel/tokens/css'
import '@ancrel/ui/styles.css'
export default function App() {
const [editing, setEditing] = useState(false)
return editing ? <label>Document title <input defaultValue="Untitled" /></label> :
<ErrorCard title="Document title already in use" tone="warning" code="E_DUPLICATE"
detail="Choose another title to save a separate copy."
actions={<Button onClick={() => setEditing(true)}>Rename document</Button>} />
}