Skip to content

Component โ€‹



Skaya's AI-powered component updater accelerates UI development with smart, context-aware scaffolding. Updates production-ready components with integrated testing, styling, and documentation in seconds.

Prerequisites

This guide assumes knowledge of:

Key Features โ€‹

FeatureDescription
๐Ÿค– AI-PoweredContext-aware generation with dynamic prop/state suggestions
๐ŸŒ Language SupportTypeScript (tsx) with strict typing enforcement
๐ŸŽจ Styling OptionsCSS | SCSS | styled-components | Tailwind
๐Ÿงช Test CoverageAuto-generated Jest/Vitest + Storybook stories
๐Ÿ”„ Dependency ImportSeamlessly import existing components and APIs

Every component includes:

  • โœ… Core component file with TypeScript interface
  • โœ… Storybook integration for visual testing
  • โœ… Unit tests with sample test cases
  • โœ… Style file (CSS/SCSS) or CSS-in-JS setup

Updating Components โ€‹

Interactive Mode โ€‹

bash
skaya update
# Follow the interactive prompts

Direct Generation โ€‹

bash
skaya update component --project frontend

Quick Start with npx โ€‹

bash
npx skaya update component -p frontend

Advanced Configuration

Custom Template Setup (Coming in v2.0) โ€‹

skaya update component --template path/to/template.json

Example Workflow with Custom imports โ€‹

1: Initiate Creation โ€‹

bash
skaya update component -p frontend

2: Configuration โ€‹

bash
? Select component to update:
  Profile
  Walletbutton
โฏ LoginButton
bash
โœ” 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 component needs to be updated, allowing for seamless integration and reusability. For instance, you might want to import a Walletbutton component and a Login API into a new Profile component.

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

B. Import BuiltIn Apis โ€‹

bash
โœ” Select component components to import: Walletbutton
? Select api components to import:
โฏโ—‰ Login

4. Ai Prompt Specification For Component Generation โ€‹

bash
โœ” Select component components to import: Walletbutton
โœ” Select api components to import: Login

--- Dependencies to be imported ---

Dependencies (component):
- Walletbutton

Dependencies (api):
- Login
-------------------------------------------------
? Enter AI Prompt on how the files and code should work: Import the walletconenctbutton and use login api to create a nftcard

5. File Generation Output โ€‹

bash
โœ… component file updated at myapp/src/components/Walletbutton/Walletbutton.tsx
โœ… component file updated at myapp/src/components/Walletbutton/Walletbutton.stories.tsx
โœ… component file updated at myapp/src/components/Walletbutton/Walletbutton.test.tsx
โœ… component file updated at myapp/src/components/Walletbutton/Walletbutton.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 and stories by default.

2. Folder structure: โ€‹

- Components are created in PascalCase
- Test/story 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 Components โ€‹

Learn how to modify existing components in our Component Update Guide.