# Components Reference `@mantine/core` provides 120+ components. This reference covers key patterns. ## Layout Components ### Container, Stack, Group, Flex ```tsx import { Container, Stack, Group, Flex } from '@mantine/core'; {/* Centers content, max-width */} {/* Vertical flex */} {/* Horizontal flex */} {/* Generic flex */} ``` ### Grid & SimpleGrid ```tsx import { Grid, SimpleGrid } from '@mantine/core'; // CSS Grid with responsive spans Responsive // Equal-width columns {/* Items */} ``` ## Button Variants ```tsx import { Button, ActionIcon } from '@mantine/core'; // Icon button ``` ## Inputs Pattern All inputs follow consistent API: ```tsx import { TextInput, PasswordInput, Textarea, NumberInput, Select } from '@mantine/core'; // Common props: label, description, error, required, placeholder ``` ## Overlays Pattern Modals, Drawers, Menus, Popovers all use similar pattern: ```tsx import { Modal, Drawer, Menu, Popover } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; // Common pattern with useDisclosure const [opened, { open, close }] = useDisclosure(false); // Modal Content // Drawer Navigation // Menu (dropdown) }>Settings Delete // Popover Details here ``` ## Feedback Components ```tsx import { Loader, Alert, Notification, Progress, Skeleton } from '@mantine/core'; // oval, bars, dots Message }> Saved! Docs // Loading placeholders ``` ## Typography ```tsx import { Title, Text, Anchor, Highlight, Code } from '@mantine/core'; h1 heading h2 dimmed Small bold dimmed Long text... Multi-line truncate... Learn React with Mantine inline {`const x = 1;`} ``` ## Data Display ```tsx import { Badge, Card, Table, Avatar, Image, Tabs, Accordion } from '@mantine/core'; // Badge variants Default Dot // Card with sections Content // Table NameJohn
// Tabs First Second Content 1 // Accordion Section 1 Content ``` ## Navigation ```tsx import { NavLink, Pagination, Stepper, Breadcrumbs } from '@mantine/core'; } active /> Content 1 Content 2 Done! ``` ## Common Style Props All components accept these props: ```tsx ``` ## Polymorphic Components Render as different elements: ```tsx import { Button } from '@mantine/core'; import { Link } from 'react-router-dom'; ``` ## Visibility Props ```tsx Hidden on sm+ Visible on md+ Only in dark mode Only in light mode ```