Skip to content
Statix Design System

Patterns · Dashboard

SecurityCard

A card for one protection feature: icon, title, a status chip, what we do, an optional setting and one action. The design uses it for the nightly virus scan.

import { SecurityCard } from '@statix/ui/security-card';

Examples

Virus scan

The full card from Penpot: description, a choice for what happens on a finding, and a "Scan now" button.

Virus protection

No viruses

Every night we scan your website for viruses and malware. Last scan today at 02:40, nothing found. You do not need to do anything.

If we find something:

We email you and change nothing without your OK.

<script lang="ts">
	import { Button } from '@statix/ui/button';
	import { SecurityCard } from '@statix/ui/security-card';
	import * as ToggleGroup from '@statix/ui/toggle-group';

	let onFinding = $state('ask');
</script>

<div class="w-full max-w-[360px]">
	<SecurityCard
		title="Virus protection"
		status="No viruses"
		description="Every night we scan your website for viruses and malware. Last scan today at 02:40, nothing found. You do not need to do anything."
	>
		<p id="on-finding" class="text-body font-medium text-ink">If we find something:</p>
		<ToggleGroup.Root
			type="single"
			bind:value={onFinding}
			aria-labelledby="on-finding"
			variant="chip"
			class="w-full *:flex-1"
		>
			<ToggleGroup.Item value="ask">Ask me first</ToggleGroup.Item>
			<ToggleGroup.Item value="remove">Remove right away</ToggleGroup.Item>
		</ToggleGroup.Root>
		<p class="text-small text-ink-2">
			{onFinding === 'ask'
				? 'We email you and change nothing without your OK.'
				: 'We clean up straight away and tell you afterwards.'}
		</p>
		{#snippet action()}
			<Button variant="outline">Scan now</Button>
		{/snippet}
	</SecurityCard>
</div>

Statuses

The chip and icon well follow statusVariant. warning and destructive switch to a shield with an alert.

Virus protection

No viruses

Last scan today at 02:40, nothing found.

Firewall

Learning

The firewall is new and watches traffic for 7 days before it blocks anything.

Virus protection

1 file found

We found malware in a plugin file and are waiting for your OK to remove it.

<script lang="ts">
	import { SecurityCard } from '@statix/ui/security-card';
</script>

<div class="grid w-full gap-4 tablet:grid-cols-3">
	<SecurityCard
		title="Virus protection"
		status="No viruses"
		description="Last scan today at 02:40, nothing found."
	/>
	<SecurityCard
		title="Firewall"
		status="Learning"
		statusVariant="warning"
		description="The firewall is new and watches traffic for 7 days before it blocks anything."
	/>
	<SecurityCard
		title="Virus protection"
		status="1 file found"
		statusVariant="destructive"
		description="We found malware in a plugin file and are waiting for your OK to remove it."
	/>
</div>

Guidelines

Do

  • End the description with whether the customer needs to act: "You do not need to do anything."
  • Keep the setting to one choice. Explain the effect under it.

Don't

  • Don’t put more than one action in the card.
  • Don’t use the card for features that are switched off. Show an upsell elsewhere.

Accessibility

  • The title is an <h3> by default; set headingLevel to fit the page.
  • The icon is decorative. The chip text carries the status.
  • Label the setting inside children. A ToggleGroup needs an aria-label or a visible label linked with aria-labelledby.

API reference

SecurityCard

renders <div> (Card) and accepts its attributes
PropTypeDefault
title * string

Card heading.

–
status string

Result in the chip.

–
statusVariant 'success' | 'warning' | 'destructive' | 'neutral'

Colour of chip and icon well.

'success'
description string

What we check and when.

–
headingLevel 2 | 3 | 4

Heading level of the title.

3
icon Snippet

Replaces the shield icon.

–
children Snippet

Setting between two hairlines.

–
action Snippet

Bottom action; buttons stretch to full width.

–
ref bindHTMLDivElement | null

The root element.

–
class ClassValue

Merged with the card classes; yours win.

–
Data attributeMeaning
data-slot="security-card"Root. Parts use security-card-header, -icon, -title, -description, -content, -action.
data-statusThe current statusVariant.