Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Created December 5, 2024 03:33
Show Gist options
  • Save johnlindquist/d4a94ea4c93b360e3082a0a37fd05464 to your computer and use it in GitHub Desktop.
Save johnlindquist/d4a94ea4c93b360e3082a0a37fd05464 to your computer and use it in GitHub Desktop.
import "@johnlindquist/kit"
import type { Choice } from "@johnlindquist/kit"
export const metadata: Metadata = {
name: "Testing Grid",
}
function generateGrid(count: number):Choice[] {
return Array.from({ length: count }, (_, i) => ({
name: `item-${i}`,
html: `<div>Item ${i}</div>`,
className: "bg-secondary justify-around",
focusedClassName: "bg-primary justify-around"
}))
}
await grid({
columnWidth: Math.floor(PROMPT.WIDTH.BASE / 3),
rowHeight: Math.floor(PROMPT.HEIGHT.BASE / 6),
gridPadding: 0,
gridGap: 0
}, generateGrid(100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment