ProseCard

GitHub
Create highlighted content blocks with optional links and navigation.

Usage

Use markdown in the default slot of the card component to highlight your content.

Use the title, icon and color props to customize it. You can also pass any property from the <NuxtLink> or <RouterLink> component.

Startup

Best suited for small teams, startups and agencies with up to 5 developers.
::card{title="Startup" icon="i-lucide-users" color="primary" to="https://nuxt.lemonsqueezy.com" target="_blank"}
Best suited for small teams, startups and agencies with up to 5 developers.
::

API

Props

Prop Default Type
to
string | et | X
target
null | "_blank" | "_parent" | "_self" | "_top" | string
icon
any
title
string
description
string
color
'primary'
"primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral"
ui
{ base?: SlotClass; icon?: SlotClass; title?: SlotClass; description?: SlotClass; externalIcon?: SlotClass; }

Slots

Slot Type
default
{}
title
{}

Theme

app.config.ts
export default defineAppConfig({
  ui: {
    prose: {
      card: {
        slots: {
          base: [
            'group relative block my-5 p-4 sm:p-6 border border-border rounded-md bg-background',
            'transition-colors'
          ],
          icon: 'size-6 mb-2 block',
          title: 'color-text-highlighted font-600',
          description: 'text-[15px] color-text-muted *:first:mt-0 *:last:mb-0 *:my-1',
          externalIcon: [
            'size-4 align-top absolute right-2 top-2 color-text-dimmed pointer-events-none',
            'transition-colors'
          ]
        },
        variants: {
          color: {
            primary: {
              icon: 'color-primary'
            },
            secondary: {
              icon: 'color-secondary'
            },
            success: {
              icon: 'color-success'
            },
            info: {
              icon: 'color-info'
            },
            warning: {
              icon: 'color-warning'
            },
            error: {
              icon: 'color-error'
            },
            neutral: {
              icon: 'color-text-highlighted'
            }
          },
          to: {
            true: ''
          },
          title: {
            true: {
              description: 'mt-1'
            }
          }
        },
        compoundVariants: [
          {
            color: 'primary',
            to: true,
            class: {
              base: 'hover:bg-primary/10 hover:border-primary outline-primary/25 has-[>a:focus-visible]:outline-3 has-[>a:focus-visible]:border-primary',
              externalIcon: 'group-hover:color-primary'
            }
          },
          {
            color: 'neutral',
            to: true,
            class: {
              base: 'hover:bg-background-elevated/50 hover:border-border-inverted outline-border-inverted/25 has-[>a:focus-visible]:outline-3 has-[>a:focus-visible]:border-border-inverted',
              externalIcon: 'group-hover:color-text-highlighted'
            }
          }
        ],
        defaultVariants: {
          color: 'primary'
        }
      }
    }
  }
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from 'pohon-ui/vite'

export default defineConfig({
  plugins: [
    vue(),
    ui({
      ui: {
        prose: {
          card: {
            slots: {
              base: [
                'group relative block my-5 p-4 sm:p-6 border border-border rounded-md bg-background',
                'transition-colors'
              ],
              icon: 'size-6 mb-2 block',
              title: 'color-text-highlighted font-600',
              description: 'text-[15px] color-text-muted *:first:mt-0 *:last:mb-0 *:my-1',
              externalIcon: [
                'size-4 align-top absolute right-2 top-2 color-text-dimmed pointer-events-none',
                'transition-colors'
              ]
            },
            variants: {
              color: {
                primary: {
                  icon: 'color-primary'
                },
                secondary: {
                  icon: 'color-secondary'
                },
                success: {
                  icon: 'color-success'
                },
                info: {
                  icon: 'color-info'
                },
                warning: {
                  icon: 'color-warning'
                },
                error: {
                  icon: 'color-error'
                },
                neutral: {
                  icon: 'color-text-highlighted'
                }
              },
              to: {
                true: ''
              },
              title: {
                true: {
                  description: 'mt-1'
                }
              }
            },
            compoundVariants: [
              {
                color: 'primary',
                to: true,
                class: {
                  base: 'hover:bg-primary/10 hover:border-primary outline-primary/25 has-[>a:focus-visible]:outline-3 has-[>a:focus-visible]:border-primary',
                  externalIcon: 'group-hover:color-primary'
                }
              },
              {
                color: 'neutral',
                to: true,
                class: {
                  base: 'hover:bg-background-elevated/50 hover:border-border-inverted outline-border-inverted/25 has-[>a:focus-visible]:outline-3 has-[>a:focus-visible]:border-border-inverted',
                  externalIcon: 'group-hover:color-text-highlighted'
                }
              }
            ],
            defaultVariants: {
              color: 'primary'
            }
          }
        }
      }
    })
  ]
})
Some colors in compoundVariants are omitted for readability. Check out the source code on GitHub.

Changelog

No recent changes