```
--------------------------------
### Custom Tooltip Content
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/configuration.md
Allows overriding the default tooltip with custom React content.
```typescript
(
Tooth {tooth?.notations.fdi}
Type: {tooth?.type}
Universal: {tooth?.notations.universal}
),
}}
/>
```
--------------------------------
### Change Callback: onChange
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/configuration.md
Called whenever selection changes. Receives array of ToothDetail objects.
```typescript
{
console.log(selected);
// [{ id: "teeth-11", notations: {...}, type: "Central Incisor" }, ...]
}}
/>
```
--------------------------------
### Visible Portion
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/configuration.md
Controls whether to render the full chart or only the upper or lower arch.
```typescript
// 4 quadrants
// 2 upper quadrants
// 2 lower quadrants
```
--------------------------------
### Tooth Conditions
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/configuration.md
An array of condition groups used to colorize teeth.
```typescript
const conditions = [
{
label: "caries",
teeth: ["teeth-11", "teeth-21"],
fillColor: "#ef4444",
outlineColor: "#b91c1c",
},
{
label: "filling",
teeth: ["teeth-14", "teeth-24"],
fillColor: "#60a5fa",
outlineColor: "#1d4ed8",
},
];
```
--------------------------------
### CSS Import
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/exports.md
How to import the CSS file separately for styling.
```typescript
import "react-odontogram/style.css";
```
--------------------------------
### Change theme and colors
Source: https://github.com/biomathcode/react-odontogram/blob/main/README.md
Demonstrates how to apply a dark theme and override the default color palette, including custom CSS variables for tooltip styling.
```tsx
import { Odontogram } from "react-odontogram";
import "react-odontogram/style.css";
export default function ThemeExample() {
return (
);
}
```
```css
.my-odontogram {
--odontogram-tooltip-bg: #0f172a;
--odontogram-tooltip-fg: #f8fafc;
}
```
--------------------------------
### Color Overrides: colors
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/configuration.md
Override theme colors via the colors prop.
```typescript
```
--------------------------------
### Inline Styles: styles
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/configuration.md
Apply inline CSS to the root div via React.CSSProperties.
```typescript
```
--------------------------------
### Tooltip Margin
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/configuration.md
Sets the distance in pixels between the tooltip and the tooth.
```typescript
```
--------------------------------
### Odontogram Component Import
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/exports.md
Importing the main Odontogram React component.
```typescript
import Odontogram from "react-odontogram";
// or
import { Odontogram } from "react-odontogram";
```
--------------------------------
### Type and Interface Imports
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/exports.md
Importing various types and interfaces from the package.
```typescript
import type {
// Literal unions
Notation,
Theme,
Placement,
ToothInteractionEvent,
// Interfaces
ToothDetail,
OdontogramColors,
OdontogramProps,
TeethProps,
OdontogramTooltipProps,
// Type aliases
ToothConditionGroup,
TooltipContentRenderer,
} from "react-odontogram";
```
--------------------------------
### getViewBox Function Import and Usage
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/exports.md
Importing and using the getViewBox function to calculate SVG viewBox.
```typescript
import { getViewBox } from "react-odontogram";
const vb = getViewBox("circle", "full");
// "0 0 409 694"
```
--------------------------------
### Read-Only Mode
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/configuration.md
Disables all selection changes and interactivity.
```typescript
```
--------------------------------
### TeethProps Interface Definition
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/exports.md
Definition of the internal TeethProps interface.
```typescript
interface TeethProps {
name: string;
outlinePath: string;
shadowPath: string;
lineHighlightPath: string | string[];
selected?: boolean;
onClick?: (name: string) => void;
onKeyDown?: (e: KeyboardEvent, name: string) => void;
children?: ReactNode;
onHover?: (name: string, event: MouseEvent) => void;
onFocus?: (name: string, event: FocusEvent) => void;
onLeave?: () => void;
onBlur?: () => void;
condition?: {
fillColor?: string;
outlineColor?: string;
};
readOnly?: boolean;
showLabel?: boolean;
label?: string;
}
```
--------------------------------
### Placement Type Definition
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/exports.md
Definition of the Placement type for tooltip positioning.
```typescript
type Placement =
| "top" | "top-start" | "top-end"
| "right" | "right-start" | "right-end"
| "bottom" | "bottom-start" | "bottom-end"
| "left" | "left-start" | "left-end"
```
--------------------------------
### Maximum Teeth
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/configuration.md
Limits the number of teeth rendered per quadrant, typically for baby or mixed dentition.
```typescript
// 6 teeth per quadrant (24 total)
// 5 teeth per quadrant (20 total)
// Default: 8 teeth per quadrant (32 total)
```
--------------------------------
### Single Select Mode: singleSelect
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/configuration.md
When true, only one tooth can be selected at a time. Clicking a selected tooth deselects it.
```typescript
```
--------------------------------
### Type Hierarchy
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/INDEX.md
Illustrates the hierarchical relationships between various types and interfaces used in the react-odontogram library, including notations, themes, placements, tooth details, and component props.
```typescript
Notation
├─ "FDI"
├─ "Universal"
└─ "Palmer"
Theme
├─ "light"
└─ "dark"
Placement (12 values)
├─ top, top-start, top-end
├─ right, right-start, right-end
├─ bottom, bottom-start, bottom-end
└─ left, left-start, left-end
ToothDetail (interface)
├─ id: string
├─ notations.fdi: string
├─ notations.universal: string
├─ notations.palmer: string
└─ type: string
OdontogramProps (interface)
├─ Selection: defaultSelected, singleSelect, onChange, name
├─ Visual: theme, colors, className, styles
├─ Layout: layout, showHalf, maxTeeth
├─ Notation: notation
├─ Conditions: teethConditions, showLabels
├─ Interaction: readOnly
├─ Tooltip: showTooltip, tooltip.{placement, margin, content}
└─ [See Configuration Reference]
OdontogramColors (interface)
├─ darkBlue?: string
├─ baseBlue?: string
└─ lightBlue?: string
ToothConditionGroup (type)
├─ label: string
├─ teeth: string[]
├─ outlineColor: string
└─ fillColor: string
```
--------------------------------
### ToothDetail Interface Definition
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/exports.md
Definition of the ToothDetail interface.
```typescript
interface ToothDetail {
id: string;
notations: {
fdi: string;
universal: string;
palmer: string;
};
type: string;
}
```
--------------------------------
### CSS Variables Available
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/INDEX.md
Lists the CSS custom properties available for theming the Odontogram component.
```css
--dark-blue: /* Theme primary color */
--base-blue: /* Theme secondary color */
--light-blue: /* Theme accent color */
--odontogram-tooltip-bg: /* Tooltip background */
--odontogram-tooltip-fg: /* Tooltip text */
```
--------------------------------
### Package.json Exports Configuration
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/exports.md
Shows the 'exports' field in package.json, which defines how different module formats (ESM, CommonJS) are exposed by the package.
```json
{
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"default": "./dist/index.mjs"
},
"./style.css": "./dist/index.css"
}
}
```
--------------------------------
### OdontogramTooltip Rendering
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/api-reference/internal-components.md
HTML structure for the OdontogramTooltip, including content and arrow indicator.
```html
```
--------------------------------
### Type: TooltipContentRenderer
Source: https://github.com/biomathcode/react-odontogram/blob/main/_autodocs/types.md
Function type for custom tooltip content rendering.
| Parameter | Type | Optional | Description |
|-----------|------|----------|-------------|
| `payload` | `ToothDetail` | Yes | Currently hovered tooth details, or undefined if no tooth is active |
| **Returns** | `ReactNode` | — | React element(s) to render inside the tooltip |
Used By
- `OdontogramProps.tooltip.content
```typescript
type TooltipContentRenderer = (payload?: ToothDetail) => ReactNode
```
```typescript
const renderer: TooltipContentRenderer = (tooth) => (
tooth ? (
Tooth {tooth.notations.fdi}
{tooth.type}
) : null
);
```