Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

using-base-ui-with-material-ui

БесплатноБез исполняемых скриптовНе проверен

Always use this skill when integrating Base UI components `@base-ui-components/react` with Material UI `@mui/material`.

siriwatknpот siriwatknp★ 2 442 звезды на GitHub

Об этом скилле

Announce on start: You must announce "Using Base UI with Material UI skill" when this skill is invoked.

Always have enough context from the Base UI documentation to build the component requested by the user.

Base UI as the foundation

Render Base UI components as a foundation for the UI and then pass render prop using proper Material UI components.

For example, a Navigation Menu, should use Link from Material UI as the render element for NavigationMenu.Link.:

import { NavigationMenu } from '@base-ui-components/react/navigation-menu';
import Box from '@mui/material/Box';
import Link from '@mui/material/Link';
import Typography from '@mui/material/Typography';

function MenuLink({
  icon,
  title,
  description,
  ...props
}: NavigationMenu.Link.Props & {
  icon?: React.ReactNode;
  title: string;
  description: string;
}) {
  return (
    <NavigationMenu.Link
      href="#"
      {...props}
      render={
        <Link
          underline="none"
          sx={{
            display: 'flex',
            gap: 1,
            p: 1.5,
            borderRadius: 0.5,
            cursor: 'pointer',
            transition: 'background-color 0.2s',
            '@media (hover: hover)': {
              '&:hover': {
                bgcolor: 'action.hover',
              },
            },
          }}
        />
      }
    >
      <Box sx={{ color: 'primary.main', display: 'flex', mt: 0.25 }}>
        {icon}
      </Box>
      <Box>
        <Typography variant="subtitle2" sx={{ fontWeight: 600, mb: 0.25 }}>
          {title}
        </Typography>
        <Typography
          variant="body2"
          sx={{ color: 'text.secondary', lineHeight: 1.4 }}
        >
          {description}
        </Typography>
      </Box>
    </NavigationMenu.Link>
  );
}

For full example, see nav-menu-01.tsx

Another example, using Button from Material UI as the render element for Base UI Trigger component:

import { Menu } from '@base-ui-components/react/menu';
import Button from '@mui/material/Button';

<Menu.Trigger render={<Button />}>File</Menu.Trigger>;

Styling

To style Base UI components, use <Box /> as a render element and pass sx prop to it. Always keep in mind that the sx values should be minimum since Material UI components already have default styling.

import { NavigationMenu } from '@base-ui-components/react/navigation-menu';
import Box from '@mui/material/Box';

<NavigationMenu.List
  render={
    <Box
      component="ul"
      sx={{
        display: 'flex',
        justifyContent: 'center',
        gap: 2,
        listStyle: 'none',
        '& .MuiButton-root[data-popup-open]': {
          bgcolor: 'action.selected',
        },
      }}
    />
  }
></NavigationMenu.List>;

Primitive/Non-interactive Components

For non-interactive Base UI components like Meter, Progress, Slider (read-only), etc. that don't have direct semantic Material UI equivalents, always use the render prop pattern with Box.

CRITICAL: Never use component={BaseUIComponent} - this is incorrect and causes issues. Always use Base UI components as the foundation with the render prop.

✅ Correct Pattern

import { Meter } from '@base-ui-components/react/meter';
import Box from '@mui/material/Box';

<Meter.Track
  render={
    <Box
      sx={{
        height: 8,
        width: '100%',
        bgcolor: 'action.disabledBackground',
        borderRadius: 1,
        overflow: 'hidden',
        position: 'relative',
      }}
    />
  }
>
  <Meter.Indicator
    render={
      <Box
        sx={{
          height: '100%',
          bgcolor: 'text.primary',
          transition: 'width 0.3s ease',
        }}
      />
    }
  />
</Meter.Track>;

❌ Incorrect Pattern

// ❌ NEVER do this - Base UI should be the foundation, not MUI Box
<Box component={Meter.Track} sx={{ ... }}>
  <Box component={Meter.Indicator} sx={{ ... }} />
</Box>

// ❌ NEVER do this - Using asChild prop (not a React pattern)
<Meter.Track asChild>
  <Box sx={{ ... }}>
    <Meter.Indicator asChild>
      <Box sx={{ ... }} />
    </Meter.Indicator>
  </Box>
</Meter.Track>

Key Points

  1. Base UI First: Always render Base UI components as the outer wrapper
  2. render Prop: Use render={<Box sx={{ ... }} />} to apply Material UI styling
  3. Theme Tokens: Use MUI theme tokens in sx prop (e.g., bgcolor: "action.hover", color: "text.primary")
  4. Minimal Styling: Keep sx props minimal - only add what's necessary for the design

Reduce duplication

If the same styles are used multiple times for the same Base UI components, create wrapper components to reduce duplication.

import { NavigationMenu } from '@base-ui-components/react/navigation-menu';

function Content(props: BoxProps) {
  return (
    <Box
      sx={{
        padding: 1,
        width: 'calc(100vw - 40px)',
        height: '10
Полный SKILL.md на GitHub

Установить using-base-ui-with-material-ui в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл using-base-ui-with-material-ui?

Always use this skill when integrating Base UI components `@base-ui-components/react` with Material UI `@mui/material`.

Как установить скилл using-base-ui-with-material-ui?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл using-base-ui-with-material-ui запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить using-base-ui-with-material-ui с