1 estrella en GitHub = 1 componente nuevo.

Tarjetas cardneumorphism

Neumorphic Card

Tarjeta de estilo neumórfico con sombras profundas y volumen visual realista.

Vista Previa en Vivo

John Doe Designer

Neumorphic design creates a soft, extruded appearance that mimics physical objects.

128 Projects
4.2k Followers

Uso

Copia y pega este código directamente en tu página de Astro:

astro
---
import { NeumorphicCard } from 'astro-component-kit';
---

<NeumorphicCard padding="lg"><p>Elevated focus container</p></NeumorphicCard>
--- import { NeumorphicCard } from 'astro-component-kit'; --- <NeumorphicCard padding="lg"><p>Elevated focus container</p></NeumorphicCard>

Instalación Manual

Si no estás usando el paquete npm, crea un archivo nuevo y pega el siguiente código: src/components/lib/NeumorphicCard.astro:

astro
---
/**
 * NeumorphicCard — Soft UI card with tactile extruded shadows calibrated for dark and light viewports.
 * 
 * @param {string} title - Optional headline for the card. Default is 'Soft UI Element'.
 * @param {string} subtitle - Descriptive supporting context.
 * @param {'sm'|'md'|'lg'} padding - Inner layout padding size. Default is 'md'.
 */
interface Props {
  title?: string;
  subtitle?: string;
  padding?: 'sm' | 'md' | 'lg';
}

const {
  title = 'Soft UI Element',
  subtitle = 'Tactile extruded neumorphic shadows calibrated for light and dark viewports.',
  padding = 'md',
} = Astro.props;
---

<div class={`neu-card neu-card--p${padding}`}>
  <div class="neu-card__inner">
    {title && <h3 class="neu-card__title">{title}</h3>}
    {subtitle && <p class="neu-card__subtitle">{subtitle}</p>}
    <slot />
  </div>
</div>

<style>
  .neu-card {
    background: #131b2e;
    border-radius: var(--r-xl, 24px);
    box-shadow: 12px 12px 24px rgba(0, 0, 0, 0.4), -8px -8px 20px rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--c-text-1, #f8fafc);
    transition: all 0.3s ease;
    max-width: 360px;
    box-sizing: border-box;
  }

  .neu-card:hover {
    box-shadow: 16px 16px 30px rgba(0, 0, 0, 0.5), -10px -10px 24px rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
  }

  .neu-card__inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .neu-card__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--c-text-1, #f8fafc);
  }

  .neu-card__subtitle {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--c-text-2, #94a3b8);
  }

  .neu-card--psm { padding: var(--sp-4, 1rem); }
  .neu-card--pmd { padding: var(--sp-6, 1.75rem); }
  .neu-card--plg { padding: var(--sp-10, 2.5rem); }
</style>
--- /** * NeumorphicCard — Soft UI card with tactile extruded shadows calibrated for dark and light viewports. * * @param {string} title - Optional headline for the card. Default is 'Soft UI Element'. * @param {string} subtitle - Descriptive supporting context. * @param {'sm'|'md'|'lg'} padding - Inner layout padding size. Default is 'md'. */ interface Props { title?: string; subtitle?: string; padding?: 'sm' | 'md' | 'lg'; } const { title = 'Soft UI Element', subtitle = 'Tactile extruded neumorphic shadows calibrated for light and dark viewports.', padding = 'md', } = Astro.props; --- <div class={`neu-card neu-card--p${padding}`}> <div class="neu-card__inner"> {title && <h3 class="neu-card__title">{title}</h3>} {subtitle && <p class="neu-card__subtitle">{subtitle}</p>} <slot /> </div> </div> <style> .neu-card { background: #131b2e; border-radius: var(--r-xl, 24px); box-shadow: 12px 12px 24px rgba(0, 0, 0, 0.4), -8px -8px 20px rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.04); color: var(--c-text-1, #f8fafc); transition: all 0.3s ease; max-width: 360px; box-sizing: border-box; } .neu-card:hover { box-shadow: 16px 16px 30px rgba(0, 0, 0, 0.5), -10px -10px 24px rgba(255, 255, 255, 0.04); transform: translateY(-2px); } .neu-card__inner { display: flex; flex-direction: column; gap: 0.5rem; } .neu-card__title { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--c-text-1, #f8fafc); } .neu-card__subtitle { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--c-text-2, #94a3b8); } .neu-card--psm { padding: var(--sp-4, 1rem); } .neu-card--pmd { padding: var(--sp-6, 1.75rem); } .neu-card--plg { padding: var(--sp-10, 2.5rem); } </style>

Información Rápida

Categoría
Tarjetas
Nombre de archivo
NeumorphicCard.astro
Dependencias
Ninguna — Astro nativo + CSS puro
Etiquetas
cardneumorphism