Command Palette

Search for a command to run...

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

animations-transitions

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

MUI transition components (Fade, Grow, Slide, Collapse, Zoom), custom transitions, TransitionGroup, and Framer Motion integration

TheLobbiот TheLobbi★ 22 звезды на GitHub

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

MUI Animations & Transitions

1. Built-in Transition Components

MUI provides five transition components built on top of react-transition-group. Each wraps a single child element and controls its enter/exit animation based on the in prop.

Fade

Opacity transition from transparent to opaque.

import { Fade, Box, Button } from '@mui/material';
import { useState } from 'react';

function FadeExample() {
  const [visible, setVisible] = useState(false);

  return (
    <>
      <Button onClick={() => setVisible((v) => !v)}>Toggle</Button>
      <Fade in={visible} timeout={300}>
        <Box sx={{ p: 2, bgcolor: 'primary.main', color: 'white' }}>
          Fading content
        </Box>
      </Fade>
    </>
  );
}

Key props:

Prop Type Default Description
in boolean false Controls visibility
timeout number | { enter, exit } 300 Duration in ms
appear boolean true Animate on initial mount when in is true
unmountOnExit boolean false Remove DOM node when exited
mountOnEnter boolean false Defer first mount until in is true

Grow

Combined scale and opacity transition. The element grows from the center (or a custom origin) while fading in.

import { Grow, Paper } from '@mui/material';

function GrowExample({ visible }: { visible: boolean }) {
  return (
    <Grow
      in={visible}
      timeout={500}
      style={{ transformOrigin: '0 0 0' }}
      {...(visible ? { timeout: 1000 } : {})}
    >
      <Paper elevation={4} sx={{ p: 3, width: 200 }}>
        Growing content
      </Paper>
    </Grow>
  );
}

Custom transform origin:

<Grow in={open} style={{ transformOrigin: 'center top' }}>
  <MenuContent />
</Grow>

Slide

Directional slide transition. The element slides in from an edge of the screen or a container.

import { Slide, Paper } from '@mui/material';
import { useRef } from 'react';

function SlideExample({ visible }: { visible: boolean }) {
  const containerRef = useRef<HTMLDivElement>(null);

  return (
    <Box ref={containerRef} sx={{ overflow: 'hidden', height: 200 }}>
      <Slide
        direction="up"
        in={visible}
        container={containerRef.current}
        timeout={{ enter: 400, exit: 200 }}
      >
        <Paper sx={{ p: 2 }}>Slides up into view</Paper>
      </Slide>
    </Box>
  );
}

direction values: 'up' | 'down' | 'left' | 'right'

When container is provided, the element slides relative to that container instead of the viewport.

Collapse

Height (or width) animation that expands/collapses content.

import { Collapse, List, ListItem, ListItemText, Button, Box } from '@mui/material';

function CollapseExample() {
  const [expanded, setExpanded] = useState(false);

  return (
    <Box>
      <Button onClick={() => setExpanded((e) => !e)}>
        {expanded ? 'Collapse' : 'Expand'}
      </Button>
      <Collapse in={expanded} timeout="auto" unmountOnExit>
        <List>
          <ListItem><ListItemText primary="Item 1" /></ListItem>
          <ListItem><ListItemText primary="Item 2" /></ListItem>
          <ListItem><ListItemText primary="Item 3" /></ListItem>
        </List>
      </Collapse>
    </Box>
  );
}

Horizontal collapse:

<Collapse in={open} orientation="horizontal" collapsedSize={40}>
  <Sidebar />
</Collapse>
Prop Type Default Description
collapsedSize number | string '0px' Minimum size when collapsed (e.g., 40 to keep a peek visible)
orientation 'vertical' | 'horizontal' 'vertical' Direction of collapse
timeout number | 'auto' duration.standard 'auto' calculates duration from height

Zoom

Scale transition from the center of the child element.

import { Zoom, Fab, AddIcon } from '@mui/material';

function ZoomFab({ visible }: { visible: boolean }) {
  return (
    <Zoom in={visible} timeout={200} unmountOnExit>
      <Fab color="primary" sx={{ position: 'fixed', bottom: 16, right: 16 }}>
        <AddIcon />
      </Fab>
    </Zoom>
  );
}

2. Usage Patterns

Basic Pattern

<Fade in={visible} timeout={300}>
  <Box>Content</Box>
</Fade>

Ref Forwarding for Custom Components

MUI transition components pass a ref to their child. If the child is a custom component, it must forward the ref:

import { forwardRef } from 'react';
import { Fade, FadeProps } from '@mui/material';

// Custom component that forwards ref
const CustomCard = forwardRef<HTMLDivElement, { title: string }>(
  function CustomCard({ title, ...props }, ref) {
    return (
      <div ref={ref} {...props}>
        <h3>{title}</h3>
      </div>
    );
  }
);

// Usage inside a transition
function AnimatedCard({ visible }: { visible: boolean }) {
  return (
    <Fade in={visible}>
      <CustomCard titl
Полный SKILL.md на GitHub

Установить animations-transitions в Claude Code и Claude Desktop

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

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

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

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

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

Read
Glob
Grep
Write
Edit

FAQ

Что делает скилл animations-transitions?

MUI transition components (Fade, Grow, Slide, Collapse, Zoom), custom transitions, TransitionGroup, and Framer Motion integration

Как установить скилл animations-transitions?

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

Скилл animations-transitions запускает скрипты?

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

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

Сравнить animations-transitions с