Internal Mantine components used on *.mantine.dev websites including Demo, MantineLogo, SearchControl, HeaderControl, and SocialButton components
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Header controls for search functionality, settings toggles, and navigation elements designed for documentation websites and developer tools.
Search input control component for triggering search functionality with keyboard shortcut display.
/**
* Search input control that displays search prompt with keyboard shortcut
* Renders as a button that can be clicked to open search functionality
*/
interface SearchControlProps extends BoxProps, ElementProps<'button'> {}
function SearchControl(props: SearchControlProps): JSX.Element;Usage Examples:
import { SearchControl } from "@mantine/ds";
function Header() {
return (
<SearchControl
onClick={() => {
// Open search modal or navigate to search page
openSearchModal();
}}
/>
);
}Generic header control wrapper that provides consistent styling and tooltip functionality.
/**
* Generic wrapper for header control buttons with tooltip support
* @param tooltip - Tooltip text displayed on hover
* @param children - Control content (usually an icon)
*/
interface HeaderControlProps extends BoxProps {
tooltip: string;
children: React.ReactNode;
}
function HeaderControl(props: HeaderControlProps): JSX.Element;Usage Examples:
import { HeaderControl } from "@mantine/ds";
import { IconSettings } from "@tabler/icons-react";
function SettingsControl() {
return (
<HeaderControl tooltip="Open settings">
<IconSettings size={18} />
</HeaderControl>
);
}Control for toggling between light and dark color schemes.
/**
* Toggle control for switching between light and dark color schemes
* Automatically handles color scheme state and provides appropriate icon
*/
function ColorSchemeControl(): JSX.Element;Control for toggling text direction (LTR/RTL) for internationalization.
/**
* Control for toggling text direction between left-to-right and right-to-left
* Useful for testing RTL languages and internationalization
*/
function DirectionControl(): JSX.Element;Pre-configured control button that links to Discord community.
/**
* Pre-configured header control that links to Discord community
* Uses Discord branding and opens link in new tab
* @param link - Optional Discord invite link, defaults to meta.discordLink
*/
function DiscordControl(props: { link?: string }): JSX.Element;Pre-configured control button that links to GitHub repository.
/**
* Pre-configured header control that links to GitHub repository
* Uses GitHub branding and opens link in new tab
* @param link - GitHub repository URL
*/
function GithubControl(props: { link: string }): JSX.Element;Container component for organizing multiple header controls.
/**
* Container component for organizing multiple header controls
* Provides consistent spacing and layout for control groups
*/
interface HeaderControlsProps extends BoxProps {
onSearch?: () => void;
githubLink?: string;
withDirectionToggle?: boolean;
withSearch?: boolean;
withGithub?: boolean;
withDiscord?: boolean;
discordLink?: string;
withColorScheme?: boolean;
}
function HeaderControls(props: HeaderControlsProps): JSX.Element;Mobile-optimized version of the search control.
/**
* Mobile-optimized search control with touch-friendly sizing
* Designed for responsive header layouts
* @param onSearch - Callback function when search is triggered
*/
function SearchMobileControl(props: { onSearch: () => void }): JSX.Element;Usage Examples:
import {
HeaderControls,
ColorSchemeControl,
DirectionControl,
DiscordControl,
GithubControl,
SearchMobileControl
} from "@mantine/ds";
function MobileHeader() {
return (
<HeaderControls
withSearch
withColorScheme
withDirectionToggle
withDiscord
withGithub
githubLink="https://github.com/mantinedev/mantine"
onSearch={() => openSearchModal()}
>
{/* Custom controls can still be added as children */}
</HeaderControls>
);
}
// Alternative: Individual controls
function CustomHeader() {
return (
<div>
<SearchMobileControl onSearch={() => openSearchModal()} />
<ColorSchemeControl />
<DirectionControl />
<DiscordControl link="https://discord.gg/mantine" />
<GithubControl link="https://github.com/mantinedev/mantine" />
</div>
);
}type BoxProps = Record<string, any>;
type ElementProps<T extends keyof JSX.IntrinsicElements, U extends string = never> =
Omit<JSX.IntrinsicElements[T], U>;