Page โ
Skaya's AI-powered page generator accelerates UI development with smart, context-aware scaffolding. Generate production-ready pages with integrated api, components, styling, and documentation in seconds.
Prerequisites
This guide assumes knowledge of:
- Basic Skaya project initialization
- Skaya component creation
- Fundamental React concepts
Key Features โ
Feature | Description |
---|---|
๐ค AI-Powered | Context-aware generation with dynamic prop/state suggestions |
๐ Language Support | TypeScript (tsx ) with strict typing enforcement |
๐จ Styling Options | CSS | SCSS | styled-components | Tailwind |
๐งช Test Coverage | Auto-generated Jest/Vitest + Storybook stories |
๐ Dependency Import | Seamlessly import existing components and APIs |
Every page includes:
- โ Core component file with TypeScript interface
- โ Unit tests with sample test cases
- โ Style file (CSS/SCSS) or CSS-in-JS setup
Creating Pages โ
Interactive Mode โ
bash
skaya create
# Follow the interactive prompts
Direct Generation โ
bash
skaya create page --project frontend --filename profile
Quick Start with npx โ
bash
npx skaya create page -p frontend -f profile
:::danger[Advanced Configuration]
Custom Template Setup (Coming in v2.0) โ
skaya create page --template path/to/template.json
:::
Example Workflow with Custom imports โ
1: Initiate Creation โ
bash
skaya create page -f profile
2: Configuration โ
bash
โ Enter the folder where you want to create the component for profile:
myapp/src/pages
โ Use AI to generate the component? Yes
? Select which required components you would like to import:
(Press <space> to select, <a> to toggle all, <i> to invert selection)
โ component
โฏ โฏ api
You can select existing components or APIs to import into your newly generated page, allowing for seamless integration and reusability. For instance, you might want to import a NftCard
component and a BuyNow
API into a new Profile
page.
- Learn how to create components in our Component Create Guide.
- Learn how to create Apis in our Api Create Guide.
3. Import Custom Selection โ
A. Import BuiltIn Componenet โ
bash
โ Select which required components you would like to import: component, api
? Select component components to import:
(Press <space> to select, <a> to toggle all, <i> to invert selection, and <enter> to proceed)
โฏโฏ Walletbutton
โฏโ NftCard
B. Import BuiltIn Apis โ
bash
โ Select component components to import: Walletbutton
? Select api components to import:
โฏโฏ Login
โฏโ BuyNow
4. Ai Prompt Specification For Page Generation โ
bash
โ Select component components to import: NftCard
โ Select api components to import: BuyNow
--- Dependencies to be imported ---
Dependencies (component):
- NftCard
Dependencies (api):
- BuyNow
-------------------------------------------------
? Enter AI Prompt on how the files and code should work: Import the Nftcard and use BuyNow api to create a pofile page
5. File Generation Output โ
bash
โ
component file created at myapp/src/pages/ProfilePage/Pofile.tsx
โ
component file created at myapp/src/pages/ProfilePage/Pofile.test.tsx
โ
component file created at myapp/src/pages/ProfilePage/Pofile.css
Key Notes โ
1. When using AI generation: โ
- You can import existing components if needed, fostering a modular and reusable codebase.
- Provide clear, specific prompts for best results, especially when defining how imported components or APIs should interact.
- Generated files include tests by default.
2. Folder structure: โ
- Pages are created in PascalCase
- Test files are automatically paired
- CSS modules are generated by default
Import Behavior โ
- Automatic Props Binding: Imported components' props are automatically wired
- API Hook Generation: Required API hooks are generated with proper typing
- Dependency Tracking: All imports are tracked in the component's metadata
Updating Pages โ
Learn how to modify existing pages in our Component Update Guide.