@cmd-kit/astro
v0.1.4
Published
Astro bindings for cmd+kit
Maintainers
Readme
@cmd-kit/astro
Astro adapter for Cmd+kit. Import the component with @cmd-kit/astro/component.
Website: https://cmd-kit.vercel.app/
Docs: https://cmd-kit.vercel.app/docs/astro
🌐 Language
🇪🇸 Español
⚡ Instalación
npm install @cmd-kit/astro astro🚀 Uso rápido
---
import CommandPalette from "@cmd-kit/astro/component";
---
<CommandPalette />✅ Qué incluye
- Componente Astro listo para usar.
- Atajo global (
mod+kpor defecto). - Navegación por teclado.
- Secciones anidadas con
children. - Recientes opcionales con deduplicación.
- Tema adaptable (oscuro/claro) por defecto.
themeen modo simple o dual (light/dark).reducedMotionpara desactivar animaciones de hover/movimiento.
🧩 Configuración de comandos
---
import CommandPalette from "@cmd-kit/astro/component";
const sections = [
{
id: "workspace",
title: "Workspace",
items: [
{
id: "overview",
title: "Overview",
subtitle: "Open the workspace overview",
shortcut: "mod+o"
},
{
id: "resources",
title: "Resources",
children: [
{
id: "resources-page",
title: "Resources",
items: [{ id: "guides", title: "Guides" }]
}
]
}
]
}
];
---
<CommandPalette
recents={{ limit: 6, sectionTitle: "Recent commands" }}
sections={sections}
theme={{
light: { accentColor: "#0fa6d8", backgroundColor: "#ffffff" },
dark: { accentColor: "#35d7ff", backgroundColor: "#0b1116" }
}}
title="Command menu"
/>🛝 Integración desde Playground
- Configura en playground.
- Exporta target
Astro. - Copia
sections(oitems) y props opcionales (messages,theme,recents,shortcut,reducedMotion). - Pégalos en tu página/componente Astro.
Nota: en Astro, el prop source es un CommandSourcePayload serializable (no función runtime).
📦 Props más usadas
itemssectionssourcemessagesthemetitleshortcutopen/defaultOpenclassNameclassNamesrecentsreducedMotion
🤝 Contribuciones
PRs e issues son bienvenidos para mejorar la experiencia Astro.
🇬🇧 English
⚡ Install
npm install @cmd-kit/astro astro🚀 Quick start
---
import CommandPalette from "@cmd-kit/astro/component";
---
<CommandPalette />✅ What you get
- Ready-to-use Astro component.
- Global shortcut (
mod+kdefault). - Keyboard navigation.
- Nested sections.
- Optional recents with dedupe.
- Default adaptive light/dark theme.
themesupports single mode or dual mode (light/dark).reducedMotionprop to disable hover/motion animations.
🛝 Playground integration
Use the Astro export target, then paste generated sections/items (+ optional props) into your Astro integration.
source in this package is a serializable payload object (CommandSourcePayload), not a runtime function.
🤝 Contributing
PRs are welcome for Astro integration bugs and improvements.
Portfolio: Fr4n0m → https://codebyfran.es
