Command Palette

Search for a command to run...

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

Component Patterns

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

UI component patterns with style-specific implementations and accessibility

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

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

Component Patterns Skill

UI component patterns with style-specific implementations and accessibility.

Overview

This skill provides comprehensive component patterns with multiple design style implementations, accessibility features, and best practices for modern frontend development.

Claude-Inspired Component Guidance

When the selected style is claude, keep component visuals calm and semantic:

  • Use surface.canvas for the page, surface.raised for cards and fields, ink.strong and ink.muted for text, and edge.subtle for 1px boundaries.
  • Use the selected palette's semantic contract (the generator defaults to brand) for coral actions and selected states; pair its solid token with contrast and use its fg token for text links.
  • Prefer radii.surface and shadows.surface, generous spacing, sentence-case labels, and readable 60-70ch content measures.
  • Avoid gradients, glass effects, decorative noise, oversized shadows, and motion that ignores prefers-reduced-motion.
  • For Chakra UI v3 token and colorPalette API details, follow the canonical chakra-ui-v3 skill.

Component Library Structure

components/
├── atoms/
│   ├── Button/
│   │   ├── Button.tsx
│   │   ├── Button.styles.ts
│   │   ├── Button.test.tsx
│   │   └── index.ts
│   ├── Input/
│   ├── Icon/
│   └── Badge/
├── molecules/
│   ├── FormField/
│   ├── Card/
│   ├── SearchBar/
│   └── MenuItem/
├── organisms/
│   ├── Navigation/
│   ├── Modal/
│   ├── Form/
│   └── DataTable/
├── templates/
│   ├── DashboardLayout/
│   ├── AuthLayout/
│   └── ContentLayout/
└── pages/
    ├── Dashboard/
    ├── Login/
    └── Profile/

Button Variants by Design Style

Base Button Component

components/atoms/Button/Button.tsx:

import React, { ButtonHTMLAttributes, forwardRef } from 'react';
import { VariantProps } from 'class-variance-authority';
import { buttonVariants } from './Button.styles';

export interface ButtonProps
  extends ButtonHTMLAttributes<HTMLButtonElement>,
    VariantProps<typeof buttonVariants> {
  loading?: boolean;
  leftIcon?: React.ReactNode;
  rightIcon?: React.ReactNode;
}

export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
  (
    {
      className,
      variant,
      size,
      styleType,
      loading,
      leftIcon,
      rightIcon,
      children,
      disabled,
      ...props
    },
    ref
  ) => {
    return (
      <button
        ref={ref}
        className={buttonVariants({ variant, size, styleType, className })}
        disabled={disabled || loading}
        aria-busy={loading}
        {...props}
      >
        {loading && (
          <span className="button-spinner" role="status" aria-label="Loading">
            <span className="sr-only">Loading...</span>
          </span>
        )}
        {!loading && leftIcon && <span className="button-icon-left">{leftIcon}</span>}
        <span className="button-content">{children}</span>
        {!loading && rightIcon && <span className="button-icon-right">{rightIcon}</span>}
      </button>
    );
  }
);

Button.displayName = 'Button';

Button Styles (Tailwind + CVA)

components/atoms/Button/Button.styles.ts:

import { cva } from 'class-variance-authority';

export const buttonVariants = cva(
  'inline-flex items-center justify-center font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
  {
    variants: {
      variant: {
        primary: '',
        secondary: '',
        outline: '',
        ghost: '',
        danger: '',
      },
      size: {
        sm: 'h-9 px-3 text-sm',
        md: 'h-10 px-4 text-base',
        lg: 'h-11 px-6 text-lg',
        xl: 'h-12 px-8 text-xl',
      },
      styleType: {
        default: '',
        glassmorphism: '',
        neumorphism: '',
        brutalist: '',
        'neo-brutalist': '',
      },
    },
    compoundVariants: [
      // Default Style
      {
        variant: 'primary',
        styleType: 'default',
        class: 'bg-primary-500 text-white hover:bg-primary-600 shadow-sm',
      },
      {
        variant: 'secondary',
        styleType: 'default',
        class: 'bg-secondary-500 text-white hover:bg-secondary-600 shadow-sm',
      },
      {
        variant: 'outline',
        styleType: 'default',
        class: 'border-2 border-primary-500 text-primary-500 hover:bg-primary-50',
      },
      {
        variant: 'ghost',
        styleType: 'default',
        class: 'text-primary-500 hover:bg-primary-50',
      },

      // Glassmorphism Style
      {
        variant: 'primary',
        styleType: 'glassmorphism',
        class: 'bg-white/10 backdrop-blur-md border border-white/20 text-white hover:bg-white/20 shadow-glass',
      },
      {
        variant: 'secondary',
        styleType: 'glassmorphism',
        class: 'bg-black/10 backdrop-blur-md border border-black/20 hover:bg-black/
Полный SKILL.md на GitHub

Установить Component Patterns в Claude Code и Claude Desktop

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

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

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

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

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

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

FAQ

Что делает скилл Component Patterns?

UI component patterns with style-specific implementations and accessibility

Как установить скилл Component Patterns?

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

Скилл Component Patterns запускает скрипты?

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

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

Сравнить Component Patterns с