⌘K
39 |Fast, composable, unstyled command menu for React.
40 |├── .github ├── FUNDING.yml └── workflows │ └── test.yml ├── .gitignore ├── .husky └── pre-commit ├── .prettierignore ├── .prettierrc.js ├── ARCHITECTURE.md ├── LICENSE.md ├── README.md ├── cmdk ├── package.json ├── src │ ├── command-score.ts │ └── index.tsx └── tsup.config.ts ├── package.json ├── playwright.config.ts ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── test ├── basic.test.ts ├── dialog.test.ts ├── group.test.ts ├── item.test.ts ├── keybind.test.ts ├── next-env.d.ts ├── numeric.test.ts ├── package.json ├── pages │ ├── _app.tsx │ ├── dialog.tsx │ ├── group.tsx │ ├── huge.tsx │ ├── index.tsx │ ├── item-advanced.tsx │ ├── item.tsx │ ├── keybinds.tsx │ ├── numeric.tsx │ ├── portal.tsx │ └── props.tsx ├── props.test.ts ├── style.css └── tsconfig.json ├── tsconfig.json └── website ├── .eslintrc.json ├── .gitignore ├── README.md ├── components ├── cmdk │ ├── framer.tsx │ ├── linear.tsx │ ├── raycast.tsx │ └── vercel.tsx ├── code │ ├── code.module.scss │ └── index.tsx ├── icons │ ├── icons.module.scss │ └── index.tsx └── index.ts ├── next-env.d.ts ├── next.config.js ├── package.json ├── pages ├── _app.tsx ├── _document.tsx └── index.tsx ├── public ├── favicon.svg ├── grid.svg ├── inter-var-latin.woff2 ├── line.svg ├── og.png ├── paco.png ├── rauno.jpeg ├── robots.txt └── vercel.svg ├── styles ├── cmdk │ ├── framer.scss │ ├── linear.scss │ ├── raycast.scss │ └── vercel.scss ├── globals.scss └── index.module.scss ├── tsconfig.json └── vercel.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: pacocoursey 2 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Run E2E tests 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v4 15 | 16 | - uses: pnpm/action-setup@v4 # respects packageManager in package.json 17 | 18 | - uses: actions/setup-node@v4 19 | with: 20 | cache: 'pnpm' 21 | 22 | - run: pnpm install 23 | env: 24 | CI: true 25 | 26 | - run: pnpm build 27 | - run: pnpm test:format 28 | - run: pnpm playwright install --with-deps 29 | - run: pnpm test || exit 1 30 | 31 | - name: Upload test results 32 | uses: actions/upload-artifact@v4 33 | with: 34 | name: playwright-report 35 | path: playwright-report.json 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | .env 4 | .env.local 5 | .env.development 6 | .env.development.local 7 | *.log 8 | yalc.lock 9 | 10 | .vercel/ 11 | .turbo/ 12 | .next/ 13 | .yalc/ 14 | build/ 15 | dist/ 16 | node_modules/ 17 | .vercel 18 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | pnpm lint-staged 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .next 2 | dist 3 | pnpm-lock.yaml 4 | .pnpm-store 5 | .vercel 6 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: false, 3 | singleQuote: true, 4 | tabWidth: 2, 5 | trailingComma: 'all', 6 | printWidth: 120, 7 | } 8 | -------------------------------------------------------------------------------- /ARCHITECTURE.md: -------------------------------------------------------------------------------- 1 | # Architecture 2 | 3 | > Document is a work in progress! 4 | 5 | ⌘K is born from a simple constraint: can you write a combobox with filtering and sorting using the [compound component](https://kentcdodds.com/blog/compound-components-with-react-hooks) approach? We didn't want to render items manually from an array: 6 | 7 | ```tsx 8 | // No 9 | <> 10 | {items.map((item) => { 11 | return
2 |
3 |
46 | 54 | 55 | {tokens.map((line, i) => ( 56 |63 | )} 64 |57 | {line.map((token, key) => ( 58 | 59 | ))} 60 |61 | ))} 62 |
Fast, composable, unstyled command menu for React.
40 |{code}
290 |