Skip to content

NewCard

The dashed card at the end of a grid that creates one more of the things beside it.

import { NewCard } from '@sypnia/ui/react'

On this page
  1. At the end of a grid
  2. As links
  3. When to use it
  4. For everyone
  5. Props

At the end of a grid

Press it.

Code
import { Card, NewCard, toast, Toaster } from '@sypnia/ui/react';

// It sits at the end of the grid it adds to, with the same size as its neighbours.
export default function InAGrid() {
  return (
    <>
      <div className="sy-grid">
        <Card title="Storefront" href="#storefront">5 tables · 5,552 rows</Card>
        <Card title="Back office" href="#back-office">12 tables · 48,210 rows</Card>
        <NewCard onClick={() => toast('This would open «New project»', { tone: 'info' })}>New project</NewCard>
      </div>
      <Toaster />
    </>
  );
}

When to use it

Use it when

  • A grid of cards the person can add to: projects, tables, boards.
  • It goes last, so it is always in the same place.

Do not use it when

  • The page already has a primary «New…» button in its header and the grid is long: one way in is enough.
  • The things are in a table: the button goes in the page header or the table toolbar.
  • The place is empty: an EmptyState explains more than a lone dashed card.

For everyone

  • It is a real button (or link, with href) named by its text: «New project».
  • The plus is decoration; the words say what will be created.
  • It has the same size as the cards beside it, so it is as easy to hit as they are.

Props

NewCardTypeDefault
href string
onClick (() => void)
  1. At the end of a grid
  2. As links
  3. When to use it
  4. For everyone
  5. Props

    Search pages, sections and terms