CompareTable
Opciones comparadas en los mismos puntos: dos formas de correr algo, Sypnia y lo que la gente usa hoy. Las columnas son las opciones, las filas los puntos; en celulares cada punto es una tarjeta.
import { CompareTable, CompareTableSkeleton } from '@sypnia/ui/react'
Formas de correr 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 | No incluido |
| Fixes by the agent | Incluido | Incluido | No incluido |
| Data stays on your servers | No incluido | Incluido | Incluido |
| Cost | From $0 | Your servers | Hours of your team |
Código
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' } },
]} />
);
} En Astro
| What happens with an error | Sypnia | A log service |
|---|---|---|
| You see it | Incluido | Incluido |
| You know why | Incluido | No incluido |
| A fix is written | Incluido | No incluido |
Código
---
// 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
Código
import { CompareTableSkeleton } from '@sypnia/ui/react';
// The comparison while it loads.
export default function Skeleton() {
return <CompareTableSkeleton columns={3} rows={4} />;
} Cuándo usarlo
Úsalo cuando
- Ayudar a alguien a elegir entre unas pocas opciones.
No lo uses cuando
- Precios y planes: usa PricingTable.
- Más de cuatro opciones: la tabla deja de leerse.
Para todos
- Es una tabla con título; los chulos y las rayas se dicen en palabras.
- En celulares cada valor lleva el nombre de su opción.
Props
| CompareTable | Tipo | Por defecto |
|---|---|---|
captionobligatorio | string | |
columnsobligatorioThe options. `lit` marks the one the page recommends. | { id: string; label: ReactNode; lit?: boolean | undefined; }[] | |
rowsobligatorio | CompareRow[] | |
rowHeaderThe name of the first column: «What you need». | string |
| CompareTableSkeleton | Tipo | Por defecto |
|---|---|---|
columns | number | 3 |
rows | number | 5 |