New Component

Create a new Astro component with TypeScript props Use when this capability is needed.

tomevault-io Updated

File contents

Create a new Astro component named $ARGUMENTS.

Instructions

  1. Determine the appropriate location:

    • General component: src/components/$ARGUMENTS.astro
    • Audit-specific: src/components/audit/$ARGUMENTS.astro
  2. Use this template:

---
interface Props {
  // Define props with TypeScript
  label: string;
  value?: number;
}

const { label, value = 0 } = Astro.props;
---

<div class="component-wrapper">
  <span class="label">{label}</span>
  <span class="value">{value}</span>
</div>

<style>
  .component-wrapper {
    /* Component styles - use CSS variables from global.css */
  }
</style>
  1. Run build to verify: npm run build

Checklist

  • TypeScript interface for props
  • Default values for optional props
  • Semantic HTML elements
  • Accessible (aria-labels if interactive)
  • Responsive design
  • Dark/light theme support via CSS variables

Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/zatsit-oss--zats-greenscore--new-component commit 5a32cc2504

Frequently asked questions

npx skillmds@latest add tomevault-io/new-component-2