A modern, interactive React Odontogram component for dental chart visualization and data collection. Built with SVG and React hooks — fully customizable, accessible, and designed for clinical or academic applications.
| Light Mode | Dark Mode |
|---|---|
![]() |
![]() |
👉 Live Preview: https://biomathcode.github.io/react-odontogram
# Using npm
npm install react-odontogram
# Using pnpm
pnpm add react-odontogram
# Using yarn
yarn add react-odontogramMake sure you have
reactandreact-dominstalled as peer dependencies.
import { Odontogram } from "react-odontogram";
import "react-odontogram/style.css";
export default function App() {
const handleChange = (selectedTeeth) => {
console.log(selectedTeeth);
/*
Example output:
[
{
"id": "teeth-21",
"notations": {
"fdi": "21",
"universal": "9",
"palmer": "1UL"
},
"type": "Central Incisor"
},
{
"id": "teeth-12",
"notations": {
"fdi": "12",
"universal": "7",
"palmer": "2UR"
},
"type": "Lateral Incisor"
}
]
*/
};
return <Odontogram onChange={handleChange} />;
}The onChange callback returns an array of selected teeth objects:
type ToothSelection = {
id: string;
notations: {
fdi: string;
universal: string;
palmer: string;
};
type: string;
};Example JSON output:
[
{
"id": "teeth-21",
"notations": {
"fdi": "21",
"universal": "9",
"palmer": "1UL"
},
"type": "Central Incisor"
},
{
"id": "teeth-12",
"notations": {
"fdi": "12",
"universal": "7",
"palmer": "2UR"
},
"type": "Lateral Incisor"
}
]| Prop | Type | Default | Description |
|---|---|---|---|
defaultSelected |
string[] |
[] |
Tooth IDs selected on first render. |
onChange |
(selectedTeeth: ToothSelection[]) => void |
— | Called whenever selection changes. |
name |
string |
"teeth" |
Name used for hidden form input. |
className |
string |
"" |
Additional class for wrapper customization. |
theme |
"light" | "dark" |
"light" |
Applies built-in light/dark palette. |
colors |
{ darkBlue?: string; baseBlue?: string; lightBlue?: string } |
{} |
Override palette colors. |
notation |
"FDI" | "Universal" | "Palmer" |
"FDI" |
Display notation in native tooth titles/tooltips. |
tooltip |
{ placement?: Placement; margin?: number; content?: ReactNode | ((payload?: ToothSelection) => ReactNode) } |
{ placement: "top", margin: 10 } |
Tooltip behavior and custom content renderer. |
showTooltip |
boolean |
true |
Enables/disables tooltip rendering. |
showHalf |
"full" | "upper" | "lower" |
"full" |
Render full chart or only upper/lower arches. |
maxTeeth |
number |
8 |
Number of teeth per quadrant (for baby/mixed dentition views). |
Each tooth is internally defined in a structured format:
{
name: "1",
type: "Central Incisor",
outlinePath: "...",
shadowPath: "...",
lineHighlightPath: "..."
}This makes it easy to extend or customize if you fork the library.
Run locally:
git clone https://github.com/biomathcode/react-odontogram.git
cd react-odontogram
pnpm install
pnpm devTo preview Storybook:
pnpm storybookMIT © biomathcode
If this library helps your dental project, please ⭐ the repo or open issues/PRs for enhancements!

