Demo
Ein Markup, drei Adapter, austauschbare Themes. Framework und Theme lassen sich frei kombinieren – die Komponente sieht immer gleich aus und verhält sich gleich. Der Code unter der Vorschau zeigt genau die gewählte Kombination.
Daten gespeichert
Ihre Änderungen sind sofort wirksam.
Daten gespeichert
Ihre Änderungen sind sofort wirksam.
Daten gespeichert
Ihre Änderungen sind sofort wirksam.
Vanilla@synatix/vanilla + @synatix/theme-kredit
import { enhanceAlert } from "@synatix/vanilla";
import "@synatix/theme-kredit/theme.css";
// Ein Container im Markup trägt data-theme="kredit".
const root = document.querySelector(
"[data-scope='alert']"
);
const cleanup = enhanceAlert(root);Vanilla@synatix/vanilla + @synatix/theme-cpool
import { enhanceAlert } from "@synatix/vanilla";
import "@synatix/theme-cpool/theme.css";
// Ein Container im Markup trägt data-theme="cpool".
const root = document.querySelector(
"[data-scope='alert']"
);
const cleanup = enhanceAlert(root);Vanilla@synatix/vanilla
import { enhanceAlert } from "@synatix/vanilla";
const root = document.querySelector(
"[data-scope='alert']"
);
const cleanup = enhanceAlert(root);React@synatix/react + @synatix/theme-kredit
import { Alert } from "@synatix/react";
import "@synatix/theme-kredit/theme.css";
export function Example() {
return (
<div data-theme="kredit">
<Alert tone="success">Daten gespeichert</Alert>
</div>
);
}React@synatix/react + @synatix/theme-cpool
import { Alert } from "@synatix/react";
import "@synatix/theme-cpool/theme.css";
export function Example() {
return (
<div data-theme="cpool">
<Alert tone="success">Daten gespeichert</Alert>
</div>
);
}React@synatix/react
import { Alert } from "@synatix/react";
export function Example() {
return (
<Alert tone="success">Daten gespeichert</Alert>
);
}Svelte@synatix/svelte + @synatix/theme-kredit
<script>
import { Alert } from "@synatix/svelte";
import "@synatix/theme-kredit/theme.css";
</script>
<div data-theme="kredit">
<Alert tone="success"><strong>Daten gespeichert</strong></Alert>
</div>Svelte@synatix/svelte + @synatix/theme-cpool
<script>
import { Alert } from "@synatix/svelte";
import "@synatix/theme-cpool/theme.css";
</script>
<div data-theme="cpool">
<Alert tone="success"><strong>Daten gespeichert</strong></Alert>
</div>Svelte@synatix/svelte
<script>
import { Alert } from "@synatix/svelte";
</script>
<Alert tone="success"><strong>Daten gespeichert</strong></Alert>Anatomie
Feste Parts dienen als Selektoren für CSS und Tests.
<div data-scope="alert" data-part="root">
<span data-part="icon">…</span>
<span data-part="title">…</span>
<span data-part="description">…</span>
</div>Props
| Prop | Typ | Standard | Beschreibung |
|---|---|---|---|
tone | "info" | "success" | "warning" | "error" | "info" | Legt den Meldungstyp und seine Darstellung fest. |
title | string | — | Fasst die Nachricht zusammen. |
live | "polite" | "assertive" | "off" | "off" | Steuert dynamische Ansagen. |
Tastatur
| Taste | Verhalten |
|---|---|
Tab | Fokussiert nur enthaltene Aktionen. |