بنقرة واحدة
create-component
Step-by-step guide to create a new Ion Design System component with all required files
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Step-by-step guide to create a new Ion Design System component with all required files
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | create-component |
| description | Step-by-step guide to create a new Ion Design System component with all required files |
Follow these steps to scaffold a new component in the Ion Design System library.
Ask the user for the component name if not provided. The name should be lowercase and hyphenated (e.g. progress-bar, date-input).
Create the directory at projects/ion/src/lib/<component-name>/.
Create <component-name>.component.ts:
import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';
@Component({
selector: 'ion-<component-name>',
imports: [],
templateUrl: './<component-name>.component.html',
styleUrls: ['./<component-name>.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class Ion<ComponentName>Component {
// Define inputs using signal-based input()
// label = input<string>();
// Define outputs using output()
// ionOnClick = output<void>();
}
Remember:
changeDetection: ChangeDetectionStrategy.OnPushhost: {} instead of @HostBinding/@HostListenerCreate <component-name>.component.html:
<!-- Use native control flow: @if, @for, @switch -->
<!-- Use [class.name] instead of ngClass -->
<!-- Use [attr.data-testid] for test selectors -->
Create <component-name>.component.scss:
// Import shared design tokens as needed
// @use '../../styles/colors/colors' as colors;
:host {
display: block;
}
Create <component-name>.component.spec.ts:
If the component uses custom types, create projects/ion/src/lib/core/types/<component-name>.ts:
export interface <ComponentName>Config {
// Define component-specific types here
}
And export from projects/ion/src/lib/core/types/index.ts.
Add the export to projects/ion/src/public-api.ts:
export * from './lib/<component-name>/<component-name>.component';
Run the following commands to validate:
npm test -- --testPathPattern=<component-name>
npm run build
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'],
};
export default meta;
export const Default: StoryObj<Ion<ComponentName>Component> = {
args: {
// Set default args
},
};
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.
Guide for creating Storybook stories for Ion Design System components
Guide for writing comprehensive tests for Ion Design System components using Jest + Angular Testing Library