| name | new-component |
| description | Scaffold a new Angular standalone component following project conventions |
New Component
Create a new Angular standalone component at the specified path.
Arguments: <component-name> [--page] [--shared]
Placement
--page: projects/ui/src/app/pages/<name>/<name>.component.ts
--shared (default): projects/ui/src/app/components/<name>/<name>.component.ts
Required Conventions
- Standalone component — no NgModule, set
standalone: true (default in Angular 20)
- Inline template — use
template not templateUrl
- Component selector:
app-<name> (kebab-case)
- CSS file — create a
.css file (not SCSS), use Tailwind CSS classes
- Signals — use Angular signals for local state, not class properties
- Imports — import Spartan UI Helm directives as needed
- Icons — if using ng-icons, use
viewProviders: [provideIcons({...})]
Template
import { Component } from '@angular/core';
@Component({
selector: 'app-COMPONENT_NAME',
template: `
<div>
<!-- Component content -->
</div>
`,
styleUrl: './COMPONENT_NAME.component.css',
})
export class ComponentNameComponent {}
After Creation
- Add the component to the appropriate route in
authenticated.routes.ts (for pages) or import it where needed (for shared components)
- Run
npm run format to auto-format
- Run
npm run lint to verify