CompareTable
Options compared on the same points: two ways of running something, Sypnia and what people use today. Columns are the options, rows the points; on phones each point is a card.
import { CompareTable, CompareTableSkeleton } from '@sypnia/ui/react'
Ways to run Sypnia
| What you need | Sypnia Cloud | On your servers | Without Sypnia |
|---|---|---|---|
| Ready in | 5 minutes | An afternoon | — |
| UpdatesNew versions and security fixes | Automatic | You run them | Not included |
| Fixes by the agent | Included | Included | Not included |
| Data stays on your servers | Not included | Included | Included |
| Cost | From $0 | Your servers | Hours of your team |
Code
import { CompareTable } from '@sypnia/ui/react';
// Options compared on the same points; the recommended one is lit. On phones each point is a card.
export default function Options() {
return (
<CompareTable caption="Ways to run Sypnia" rowHeader="What you need" columns={[{ id: 'cloud', label: 'Sypnia Cloud', lit: true }, { id: 'self', label: 'On your servers' }, { id: 'none', label: 'Without Sypnia' }]} rows={[
{ id: 'setup', label: 'Ready in', values: { cloud: '5 minutes', self: 'An afternoon', none: '—' } },
{ id: 'updates', label: 'Updates', hint: 'New versions and security fixes', values: { cloud: 'Automatic', self: 'You run them', none: null } },
{ id: 'agent', label: 'Fixes by the agent', values: { cloud: true, self: true, none: false } },
{ id: 'data', label: 'Data stays on your servers', values: { cloud: false, self: true, none: true } },
{ id: 'cost', label: 'Cost', values: { cloud: 'From $0', self: 'Your servers', none: 'Hours of your team' } },
]} />
);
} In Astro
| What happens with an error | Sypnia | A log service |
|---|---|---|
| You see it | Included | Included |
| You know why | Included | Not included |
| A fix is written | Included | Not included |
Code
---
// The Astro twin: the same table and the same phone cards, with no JavaScript.
import CompareTable from '@sypnia/ui/astro/CompareTable.astro';
---
<CompareTable caption="Sypnia and a log service" rowHeader="What happens with an error" columns={[{ id: 'us', label: 'Sypnia', lit: true }, { id: 'logs', label: 'A log service' }]} rows={[
{ id: 'see', label: 'You see it', values: { us: true, logs: true } },
{ id: 'why', label: 'You know why', values: { us: true, logs: false } },
{ id: 'fix', label: 'A fix is written', values: { us: true, logs: false } },
]} /> Skeleton
Code
import { CompareTableSkeleton } from '@sypnia/ui/react';
// The comparison while it loads.
export default function Skeleton() {
return <CompareTableSkeleton columns={3} rows={4} />;
} When to use it
Use it when
- Helping someone choose between a few options.
Do not use it when
- Prices and plans: use PricingTable.
- More than four options: the table stops being readable.
For everyone
- It is a table with a caption; checks and dashes are said in words.
- On phones each value carries the name of its option.
Props
| CompareTable | Type | Default |
|---|---|---|
captionrequired | string | |
columnsrequiredThe options. `lit` marks the one the page recommends. | { id: string; label: ReactNode; lit?: boolean | undefined; }[] | |
rowsrequired | CompareRow[] | |
rowHeaderThe name of the first column: «What you need». | string |
| CompareTableSkeleton | Type | Default |
|---|---|---|
columns | number | 3 |
rows | number | 5 |