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'
The three kinds of case
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
onSelectit is a toggle button named after its case.
Props
| CaseNode | Type | Default |
|---|---|---|
noderequired | UseCase | |
haloIdThe id of the halo gradient, from the CaseMap that draws it. | string | |
onSelect | ((id: string) => void) | |
selected | boolean |