Skip to content

Installation

Choose your preferred package manager to install the components. The package includes TypeScript definitions out of the box and requires no additional configuration.

Terminal window
npm install accessible-astro-components

Our themes come with all the components pre-installed and configured. You can choose between using git clone or degit for installation.

Terminal window
git clone https://github.com/incluud/accessible-astro-starter.git my-project
Terminal window
git clone https://github.com/incluud/accessible-astro-dashboard.git my-dashboard

After installing, you’ll need to set up your project. The steps differ slightly depending on whether you’re using the components package or a theme.

  1. Import the components you need:

    ---
    import { Modal, Notification } from 'accessible-astro-components'
    ---
  2. Add the component to your template:

    <Modal triggerId="modal" title="Welcome">
    <p>Content goes here</p>
    </Modal>
  1. Install dependencies:

    Terminal window
    cd my-project
    npm install
  2. Start development server:

    Terminal window
    npm run dev

Some components can be enhanced with additional packages to unlock their full potential. Here’s what we recommend:

To use icons in components like Notifications:

Terminal window
npm install astro-icon

We recommend using ESLint with accessibility rules to catch common issues during development:

Terminal window
npm install -D eslint-plugin-jsx-a11y

Here are some common issues you might encounter and how to resolve them:

  1. Port conflicts: If port 4321 is in use, Astro will automatically try the next available port.

  2. Node.js version: Ensure you’re using Node.js 18.14.1 or higher:

Terminal window
node --version
  1. Dependency conflicts: Clear your dependencies and reinstall if needed:
Terminal window
rm -rf node_modules package-lock.json
npm install