Skip to content
jp-ui-components logo

jp-ui Components

jp-ui-components

jp-uiのコンポーネント作成とStorybook Page作成のルールを守るためのスキル。Base UIラッパーの方針、render/useRenderの維持、レイアウト/余白/幅ルールを適用する。

SKILL.md

Full skill instructions

jp-ui Components

方針

  • 既存のPageに合わせる: src/​pages/​ColorsPage.*, src/​pages/​IconsPage.*, src/​pages/​TypesettingPage.* を基準にする。
  • Pageは基本「背景・文字色・上下余白」を持つラッパーで、中身は適切なmax-widthのコンテナで中央寄せする。
  • 「幅を満たす系(Field, InputBoxなど)」も、コンテナの幅はmax-widthで制限し、要素はコンテナ幅100% にする。
  • ルールを守らない実装が出やすいので、幅・中央寄せ・コンテナ構造は明示的にコード化する。

実装ルール(必須)

  1. Pageラッパー

    • padding と background/color を指定する。
    • 例: padding: 32px 16px 80px; background-color: var(--surface); color: var(--on-surface);
  2. 中央寄せコンテナ

    • max-width は デフォルト 640px とする。
    • 特別な指定がある場合のみ、その数値を使う(例: 一覧/グリッドで max-width: 960px)。
    • margin: 0 auto; width: 100%; を指定する。
  3. 幅を満たす系アイテム(Field, InputBox など)

    • コンテナ内で width: 100% とし、コンテナのmax-widthで制約する。
    • 画面全幅に引き伸ばさない。必ず中央寄せコンテナの中に置く。

コンポーネント作成ルール(必須)

  1. Base UIラッパーが原則

    • Base UIコンポーネントは原則ラッパーTSXを作り、利用体験を統一する(className自動付与・variant/​slotの共通化など)。
    • 例外として、ラッパーが不要なほど単純な場合のみBase UIを直接使用する。
  2. render/​useRenderの維持

    • Base UIのrenderの仕組みは壊さない。className が関数のときも必ずマージする。
    • 自前コンポーネントはuseRenderを使い、renderを透過できるAPIにする。
  3. テンプレ利用

    • Base UIラッパーは templates/​base-ui-wrapper.tsx をベースに作成する。
    • 自前コンポーネントは templates/​custom-use-render.tsx をベースに作成する。
  4. Exampleを正にする

    • 各コンポーネントには Example.tsx を同階層に作り、Exampleを実装例の正とする。
    • StorybookのDefaultは render: () => <Example /> を基本とする。
    • docs/​llm は Example を元に自動生成されるため、Exampleが実装例の唯一の情報源になる。
    • 同一ディレクトリに複数コンポーネントがある場合は *Example.tsx で区別して良い。

推奨構成(最小形)

// src/​pages/​FooPage.tsx
import styles from './​FooPage.module.css';

export function FooPage() {
  return (
    <div className={styles.Page}>
      <div className={styles.Container}>
        {/​* contents */​}
      </​div>
    </​div>
  );
}
/​* src/​pages/​FooPage.module.css */
.Page {
  padding: 32px 16px 80px;
  background-color: var(--surface);
  color: var(--on-surface);
}

.Container {
  width: 100%;
  max-width: 640px; /​* default. override when specified */
  margin: 0 auto;
}

追加メモ

  • 既存Pageの実装に合わせて、display: grid や gap は必要に応じて追加する。
  • ルールがぶれそうな場合は、Containerの責務をコメントで短く明示する。

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View