Skip to content

CaseNode

One use case of a CaseMap: a point of light with its halo and its name under it. The focal case is bigger; a request outside the map is dim, with a dashed ring.

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

On this page
  1. The three kinds of case
  2. When to use it
  3. For everyone
  4. Props

The three kinds of case

See the menuPlace an orderLeave a reviewout of the map
Code
import { CaseNode } from '@sypnia/ui/react';

// The point of a CaseMap on its own: an ordinary case, the focal case, and a request outside the map.
export default function Alone() {
  return (
    <svg viewBox="0 0 480 140" role="img" aria-label="Three kinds of case: ordinary, focal and outside the map" style={{ width: '100%', maxWidth: 480, overflow: 'visible' }}>
      <CaseNode node={{ id: 'a', name: 'See the menu', x: 80, y: 50 }} />
      <CaseNode node={{ id: 'b', name: 'Place an order', x: 240, y: 50, focal: true }} />
      <CaseNode node={{ id: 'c', name: 'Leave a review', x: 400, y: 50, out: true }} />
    </svg>
  );
}

When to use it

Use it when

  • Inside a CaseMap, or in an SVG of yours that explains one case.

Do not use it when

  • Buttons or menu items: it is a mark on a map.

For everyone

  • With onSelect it is a toggle button named after its case.

Props

CaseNodeTypeDefault
noderequired UseCase
haloId

The id of the halo gradient, from the CaseMap that draws it.

string
onSelect ((id: string) => void)
selected boolean
  1. The three kinds of case
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms