About
A card that toggles between selected and unselected states with an accent border. For navigation use ClickableCard. Astryx by Meta. Source: https://astryx.atmeta.com/components/SelectableCard
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Selectable Card to your project and fits it to your theme.
Code
How Astryx Selectable Card is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
'use client';
/* Copyright (c) 2026 Meta Platforms, Inc. See MIT notice in astryx-selectable-card.tsx. */
import '@/components/ui/astryx-selectable-card-utils/astryx-preview.css';
import {useState} from 'react';
import {SelectableCard} from '@/components/ui/astryx-selectable-card';
import {Stack} from '@astryxdesign/core/Layout';
import {Text, Heading} from '@astryxdesign/core/Text';
const addOns = [
{
id: 'storage',
name: 'Extra storage',
price: '+$5/mo',
desc: '100 GB more space',
},
{
id: 'support',
name: 'Priority support',
price: '+$15/mo',
desc: 'Replies within an hour',
},
{
id: 'backups',
name: 'Daily backups',
price: '+$10/mo',
desc: 'Kept for 30 days',
},
];
function OfficialSample() {
const [selected, setSelected] = useState(new Set(['backups']));
return (
<div style={{display: 'grid', width: '100%', gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 172px), 1fr))', gap: 12}}>
{addOns.map(addOn => (
<SelectableCard
key={addOn.id}
label={addOn.name}
isSelected={selected.has(addOn.id)}
onChange={isNow => {
setSelected(prev => {
const next = new Set(prev);
if (isNow) {
next.add(addOn.id);
} else {
next.delete(addOn.id);
}
return next;
});
}}
width="100%">
<Stack direction="vertical" gap={1}>
<Heading level={4}>{addOn.name}</Heading>
<Text type="large" weight="bold">
{addOn.price}
</Text>
<Text type="supporting" color="secondary">
{addOn.desc}
</Text>
</Stack>
</SelectableCard>
))}
</div>
);
}
export default function Demo() {
return (
<div className="astryx-demo" data-astryx-theme="neutral" data-theme="light">
<div className="astryx-demo-content" data-centered style={{maxWidth: 580}}>
<OfficialSample />
</div>
</div>
);
}















