React components library focused on usability, accessibility and developer experience
npx @tessl/cli install tessl/npm-mantine--core@8.2.0Mantine Core is a comprehensive React components library focused on usability, accessibility, and developer experience. Built with TypeScript, it provides 100+ production-ready components with a complete design system, flexible theming capabilities, and consistent API patterns.
npm install @mantine/coreimport { MantineProvider, Button, Text, Box } from "@mantine/core";For CommonJS:
const { MantineProvider, Button, Text, Box } = require("@mantine/core");CSS imports are also required:
import "@mantine/core/styles.css";import { MantineProvider, Button, Text, Stack } from "@mantine/core";
import "@mantine/core/styles.css";
function App() {
return (
<MantineProvider>
<Stack>
<Text size="xl" fw={500}>
Welcome to Mantine
</Text>
<Button variant="filled" size="md">
Click me
</Button>
</Stack>
</MantineProvider>
);
}
// Advanced usage with theming
import { createTheme, MantineProvider, Button } from "@mantine/core";
const theme = createTheme({
colors: {
brand: [
'#f0f9ff',
'#e0f2fe',
'#bae6fd',
'#7dd3fc',
'#38bdf8',
'#0ea5e9',
'#0284c7',
'#0369a1',
'#075985',
'#0c4a6e'
]
},
primaryColor: 'brand'
});
function ThemedApp() {
return (
<MantineProvider theme={theme}>
<Button color="brand">Themed button</Button>
</MantineProvider>
);
}Mantine Core is built around several key architectural concepts:
factory system that provides consistent API patterns, polymorphic props, and styling capabilitiesBox component serves as the foundation for all Mantine components, providing base styling props and polymorphic renderingMantineProvider manages global theme configuration, CSS variables, color schemes, and styling contextclassNames and styles propsModal.Root, Modal.Content) for flexible compositionComplete theming and styling system with provider configuration, CSS variables, color schemes, and design tokens.
function MantineProvider(props: MantineProviderProps): JSX.Element;
interface MantineProviderProps {
theme?: MantineThemeOverride;
colorSchemeManager?: MantineColorSchemeManager;
defaultColorScheme?: MantineColorScheme;
forceColorScheme?: 'light' | 'dark';
cssVariablesSelector?: string;
withCssVariables?: boolean;
children: React.ReactNode;
}
function createTheme(theme: MantineThemeOverride): MantineTheme;Foundation components including Box, factory system, and essential utilities that power the entire library.
function Box<C = 'div'>(props: BoxProps<C>): JSX.Element;
interface BoxProps<C = 'div'> extends MantineStyleProps {
component?: C;
className?: string;
style?: MantineStyleProp;
children?: React.ReactNode;
}
function factory<Payload extends FactoryPayload>(payload: Payload): Factory<Payload>;Flexible layout components for building responsive interfaces including Grid, Flex, Stack, and AppShell.
function Grid(props: GridProps): JSX.Element;
function Flex(props: FlexProps): JSX.Element;
function Stack(props: StackProps): JSX.Element;
function AppShell(props: AppShellProps): JSX.Element;
// Compound components
AppShell.Header;
AppShell.Navbar;
AppShell.Main;
AppShell.Footer;
AppShell.Aside;Comprehensive form controls including Input system, Select components, Checkbox, Radio, and specialized inputs.
function Input(props: InputProps): JSX.Element;
function TextInput(props: TextInputProps): JSX.Element;
function Select(props: SelectProps): JSX.Element;
function Checkbox(props: CheckboxProps): JSX.Element;
// Input compound components
Input.Wrapper;
Input.Label;
Input.Description;
Input.Error;Navigation and user flow components including Tabs, Stepper, Breadcrumbs, and Pagination.
function Tabs(props: TabsProps): JSX.Element;
function Stepper(props: StepperProps): JSX.Element;
function Breadcrumbs(props: BreadcrumbsProps): JSX.Element;
function Pagination(props: PaginationProps): JSX.Element;
// Navigation compound components
Tabs.List;
Tabs.Panel;
Tabs.Tab;User feedback components including Alert, Progress indicators, Loader, and Notification systems.
function Alert(props: AlertProps): JSX.Element;
function Progress(props: ProgressProps): JSX.Element;
function Loader(props: LoaderProps): JSX.Element;
function Notification(props: NotificationProps): JSX.Element;
// Progress compound components
Progress.Root;
Progress.Section;
Progress.Label;Modal dialogs, drawers, popovers, and tooltip components for overlay interfaces.
function Modal(props: ModalProps): JSX.Element;
function Drawer(props: DrawerProps): JSX.Element;
function Popover(props: PopoverProps): JSX.Element;
function Tooltip(props: TooltipProps): JSX.Element;
// Modal compound components
Modal.Root;
Modal.Overlay;
Modal.Content;
Modal.Header;
Modal.Title;
Modal.Body;
Modal.CloseButton;Components for displaying data including Table, List, Card, Avatar, and Image components.
function Table(props: TableProps): JSX.Element;
function List(props: ListProps): JSX.Element;
function Card(props: CardProps): JSX.Element;
function Avatar(props: AvatarProps): JSX.Element;
// Table compound components
Table.Thead;
Table.Tbody;
Table.Tr;
Table.Th;
Table.Td;
Table.ScrollContainer;Interactive buttons and text display components including Button, ActionIcon, Text, Title, and formatting utilities.
function Button(props: ButtonProps): JSX.Element;
function ActionIcon(props: ActionIconProps): JSX.Element;
function Text(props: TextProps): JSX.Element;
function Title(props: TitleProps): JSX.Element;
function Code(props: CodeProps): JSX.Element;
// Button variants and groups
Button.Group;
ActionIcon.Group;Button and Typography Components
Mantine Core also re-exports useful third-party libraries:
// From react-remove-scroll
export { RemoveScroll } from 'react-remove-scroll';Required peer dependencies for proper functionality: