In-page message for important information, with info, success, warning, and danger variants.
Heads up
Heads up
Heads up
Heads up
Heads up
Heads up
Update available
Payment received
Quota almost full
Could not save
Update available
Payment received
Quota almost full
Could not save
<x-markas.alert variant="info" title="Heads up">You can add components to your app with the CLI.</x-markas.alert><x-markas.alert variant="success" title="Heads up">You can add components to your app with the CLI.</x-markas.alert><x-markas.alert variant="warning" title="Heads up">You can add components to your app with the CLI.</x-markas.alert><x-markas.alert variant="danger" title="Heads up">You can add components to your app with the CLI.</x-markas.alert>import { Alert } from "@/components/markas/Alert";
<Alert variant="info" title="Heads up">You can add components to your app with the CLI.</Alert>import { Alert } from "@/components/markas/Alert";
<Alert variant="success" title="Heads up">You can add components to your app with the CLI.</Alert>import { Alert } from "@/components/markas/Alert";
<Alert variant="warning" title="Heads up">You can add components to your app with the CLI.</Alert>import { Alert } from "@/components/markas/Alert";
<Alert variant="danger" title="Heads up">You can add components to your app with the CLI.</Alert>import Alert from "@/components/markas/Alert.vue";
<Alert variant="info" title="Heads up">You can add components to your app with the CLI.</Alert>import Alert from "@/components/markas/Alert.vue";
<Alert variant="success" title="Heads up">You can add components to your app with the CLI.</Alert>import Alert from "@/components/markas/Alert.vue";
<Alert variant="warning" title="Heads up">You can add components to your app with the CLI.</Alert>import Alert from "@/components/markas/Alert.vue";
<Alert variant="danger" title="Heads up">You can add components to your app with the CLI.</Alert>Examples
Without title
<div class="grid gap-3">
<x-markas.alert role="status">Your changes are saved as a draft until you publish.</x-markas.alert>
<x-markas.alert variant="success">Your password has been changed.</x-markas.alert>
<x-markas.alert variant="warning">This link expires in 24 hours.</x-markas.alert>
<x-markas.alert variant="danger">You do not have permission to edit this page.</x-markas.alert>
</div><script lang="ts">
import Alert from "$lib/components/markas/Alert.svelte";
</script>
<div class="grid gap-3">
<Alert role="status">
Your changes are saved as a draft until you publish.
</Alert>
<Alert variant="success">Your password has been changed.</Alert>
<Alert variant="warning">This link expires in 24 hours.</Alert>
<Alert variant="danger">You do not have permission to edit this page.</Alert>
</div>With actions
Your trial ends in 3 days
Upgrade now to keep access to all of your projects.
Sync failed
We could not reach the server. Your last 2 edits are not saved.
Your trial ends in 3 days
Upgrade now to keep access to all of your projects.
Sync failed
We could not reach the server. Your last 2 edits are not saved.
Your trial ends in 3 days
Upgrade now to keep access to all of your projects.
Sync failed
We could not reach the server. Your last 2 edits are not saved.
Your trial ends in 3 days
Upgrade now to keep access to all of your projects.
Sync failed
We could not reach the server. Your last 2 edits are not saved.
Your trial ends in 3 days
Upgrade now to keep access to all of your projects.
Sync failed
We could not reach the server. Your last 2 edits are not saved.
Error list
Please fix 3 errors
- Email address is required.
- Password must be at least 8 characters.
- Accept the terms to continue.
Please fix 3 errors
- Email address is required.
- Password must be at least 8 characters.
- Accept the terms to continue.
Please fix 3 errors
- Email address is required.
- Password must be at least 8 characters.
- Accept the terms to continue.
Please fix 3 errors
- Email address is required.
- Password must be at least 8 characters.
- Accept the terms to continue.
Please fix 3 errors
- Email address is required.
- Password must be at least 8 characters.
- Accept the terms to continue.
<x-markas.alert variant="danger" title="Please fix 3 errors">
<ul class="grid list-disc gap-1 pl-5">
<li>Email address is required.</li>
<li>Password must be at least 8 characters.</li>
<li>Accept the terms to continue.</li>
</ul>
</x-markas.alert><script lang="ts">
import Alert from "$lib/components/markas/Alert.svelte";
</script>
<Alert variant="danger" title="Please fix 3 errors">
<ul class="grid list-disc gap-1 pl-5">
<li>Email address is required.</li>
<li>Password must be at least 8 characters.</li>
<li>Accept the terms to continue.</li>
</ul>
</Alert>---
import Alert from "@/components/markas/Alert.astro";
---
<Alert variant="danger" title="Please fix 3 errors">
<ul class="grid list-disc gap-1 pl-5">
<li>Email address is required.</li>
<li>Password must be at least 8 characters.</li>
<li>Accept the terms to continue.</li>
</ul>
</Alert>In a card
Delete workspace
All projects, files, and members will be removed.
This cannot be undone
Delete workspace
All projects, files, and members will be removed.
This cannot be undone
Delete workspace
All projects, files, and members will be removed.
This cannot be undone
Delete workspace
All projects, files, and members will be removed.
This cannot be undone
Delete workspace
All projects, files, and members will be removed.
This cannot be undone
<div class="grid gap-4 rounded-lg border border-line bg-surface p-5">
<div class="grid gap-1">
<h3 class="text-base font-semibold text-ink">Delete workspace</h3>
<p class="text-sm text-muted">All projects, files, and members will be removed.</p>
</div>
<x-markas.alert variant="danger" title="This cannot be undone">Export your data first if you want to keep a copy.</x-markas.alert>
<div class="flex justify-end gap-2">
<x-markas.button variant="secondary">Cancel</x-markas.button>
<x-markas.button variant="danger">Delete workspace</x-markas.button>
</div>
</div>Installation
npx markasui@latest add alertpnpm dlx markasui@latest add alertyarn dlx markasui@latest add alertbunx --bun markasui@latest add alert- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
resources/views/components/markas/alert.blade.php.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Alert.tsx.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Alert.vue.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/lib/components/markas/Alert.svelte.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Alert.astro.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/app/markas/alert.component.ts.
Usage
<x-markas.alert title="Update available" role="status">Version 2.1 can be installed at any time.</x-markas.alert>
<x-markas.alert variant="danger" title="Could not save">Check your internet connection and try again.</x-markas.alert>import { Alert } from "@/components/markas/Alert";
<Alert title="Update available" role="status">
Version 2.1 can be installed at any time.
</Alert>
<Alert variant="danger" title="Could not save">
Check your internet connection and try again.
</Alert><script setup lang="ts">
import Alert from "@/components/markas/Alert.vue";
</script>
<template>
<Alert title="Update available" role="status">
Version 2.1 can be installed at any time.
</Alert>
<Alert variant="danger" title="Could not save">
Check your internet connection and try again.
</Alert>
</template><script lang="ts">
import Alert from "$lib/components/markas/Alert.svelte";
</script>
<Alert title="Update available" role="status">
Version 2.1 can be installed at any time.
</Alert>
<Alert variant="danger" title="Could not save">
Check your internet connection and try again.
</Alert>---
import Alert from "@/components/markas/Alert.astro";
---
<Alert title="Update available" role="status">
Version 2.1 can be installed at any time.
</Alert>
<Alert variant="danger" title="Could not save">
Check your internet connection and try again.
</Alert>import { Component } from "@angular/core";
import { Alert } from "./markas/alert.component";
@Component({
selector: "app-status",
imports: [Alert],
template: `
<markas-alert title="Update available" role="status">
Version 2.1 can be installed at any time.
</markas-alert>
<markas-alert variant="danger" title="Could not save">
Check your internet connection and try again.
</markas-alert>
`,
})
export class Status {}- The default
role="alert"is announced by screen readers right away. For non-urgent information, setrole="status". - No JavaScript, so the Blade version does not need Alpine.js.
Props
| Name | Type | Default | Description |
|---|---|---|---|
variant | 'info' | 'success' | 'warning' | 'danger' | info | Background, border, and icon color. |
title | string | - | Bold heading above the body. Pass the body through the slot or children. |
role | 'alert' | 'status' | alert | Native role attribute. Use status for non-urgent information so screen readers do not interrupt. |
Accessibility
- Defaults to role alert, so screen readers announce an alert that appears after page load right away.
- Set role status for non-urgent information.
- The icon is decorative (aria-hidden). Meaning is carried by the title and text.
- Title and body use the ink color, so contrast meets AA in light and dark mode.
Related components
More feedback components with the same classes in every framework.
- BadgeSmall pill-shaped status label with a colored dot for neutral, primary, success, warning, and danger.
- ProgressProgress bar built on the native progress element, with a label, percentage, and indeterminate mode.
- SkeletonPulsing placeholder for content that is loading, sized through classes.
- ToastShort notification in the bottom right corner that dismisses itself, triggered with the toast() function or an event.