Alert
Displays a callout for user attention.
Heads up!
You can add components to your app using the cli.
import { component$ } from '@builder.io/qwik';
import { LuRocket } from '@qwikest/icons/lucide';
import { Alert } from '~/components/ui';
export default component$(() => {
return (
<Alert.Root>
<LuRocket class="h-4 w-4" />
<Alert.Title>Heads up!</Alert.Title>
<Alert.Description>
You can add components to your app using the cli.
</Alert.Description>
</Alert.Root>
);
});
Installation
Run the following cli command or copy/paste the component code into your project
Usage
Examples
Alert
Error
Your session has expired. Please log in again.
import { component$ } from '@builder.io/qwik';
import { Alert } from '~/components/ui';
import { LuAlertTriangle } from '@qwikest/icons/lucide';
export default component$(() => {
return (
<Alert.Root look="alert">
<LuAlertTriangle class="h-4 w-4" />
<Alert.Title>Error</Alert.Title>
<Alert.Description>
Your session has expired. Please log in again.
</Alert.Description>
</Alert.Root>
);
});
Primary
Error
Your session has expired. Please log in again.
import { component$ } from '@builder.io/qwik';
import { Alert } from '~/components/ui';
import { LuAlertTriangle } from '@qwikest/icons/lucide';
export default component$(() => {
return (
<Alert.Root look="primary">
<LuAlertTriangle class="h-4 w-4" />
<Alert.Title>Error</Alert.Title>
<Alert.Description>
Your session has expired. Please log in again.
</Alert.Description>
</Alert.Root>
);
});