بنقرة واحدة
create-story
Guide for creating Storybook stories for Ion Design System components
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Guide for creating Storybook stories for Ion Design System components
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Guides creating new components for the Ion Design System. Use this skill whenever the user asks to create, add, or build a new Ion component, new DS component, or new design system component. This skill MUST be used even if the user just says "create a component" or "add a new component" without being explicit — if the context is the Ion repo, always invoke this skill. It enforces that existing Ion components are reused inside new ones instead of native HTML elements.
Guides cherry-picking commits from the main branch (Angular v21) to support/v19 or support/v8 in the Ion Design System. Use this skill whenever the user mentions cherry-pick, backport, porting a fix or feature to v19/v8/support branches, propagating changes between branches, or needs to apply a commit from main to an older branch.
Step-by-step guide to create a new Ion Design System component with all required files
Guide for writing comprehensive tests for Ion Design System components using Jest + Angular Testing Library
| name | create-story |
| description | Guide for creating Storybook stories for Ion Design System components |
Follow this guide to create a Storybook story for an Ion component.
Read the component's .component.ts to understand all inputs, outputs, and variants.
Create projects/ion/src/stories/<component-name>.stories.ts:
import type { Meta, StoryObj } from '@storybook/angular';
import { Ion<ComponentName>Component } from '../lib/<component-name>/<component-name>.component';
const meta: Meta<Ion<ComponentName>Component> = {
title: 'Components/<ComponentName>',
component: Ion<ComponentName>Component,
tags: ['autodocs'],
argTypes: {
// Map outputs to Storybook actions
ionOnClick: { action: 'clicked' },
// Configure controls for specific inputs
type: {
control: { type: 'select' },
options: ['primary', 'secondary', 'ghost', 'dashed'],
},
size: {
control: { type: 'select' },
options: ['sm', 'md', 'lg', 'xl'],
},
},
};
export default meta;
Create a story for each meaningful state of the component:
export const Default: StoryObj<Ion<ComponentName>Component> = {
args: {
label: 'Default Button',
type: 'primary',
size: 'md',
},
};
export const Disabled: StoryObj<Ion<ComponentName>Component> = {
args: {
label: 'Disabled',
disabled: true,
},
};
export const Loading: StoryObj<Ion<ComponentName>Component> = {
args: {
label: 'Loading...',
loading: true,
},
};
If the component requires a service, provide it via applicationConfig:
import { MyService } from '../lib/my/my.service';
const meta: Meta<IonMyComponent> = {
// ...
render: (args) => ({
props: args,
applicationConfig: {
providers: [MyService],
},
}),
};
npm run storybook
Navigate to http://localhost:6006 and verify the component renders correctly in all story variants.