1 GitHub star = 1 new component.

App & Dashboard appdashboardsaasreal-estatecrmtopbarsearchpopovershell

Estate CRM Topbar

Real estate CRM top bar with mobile menu button, search, theme toggle, notifications and user menu built on the native popover attribute.

Live Preview

Notificaciones

  • Nuevo lead (sin leer) Carmen Ruiz pregunta por el ático de Ruzafa hace 12 min
  • Oferta recibida 695.000 € por el piso de Pla del Real hace 2 h

Lucía Ferrer

lucia@nido.example

Usage

Copy and paste this code into your Astro page:

astro
---
import { EstateCrmTopbar } from 'astro-component-kit/app';
---

<EstateCrmTopbar navId="estate-crm-nav" user={{ name: 'Lucía Ferrer', role: 'Directora comercial' }} signOutHref="/acceso" />
--- import { EstateCrmTopbar } from 'astro-component-kit/app'; --- <EstateCrmTopbar navId="estate-crm-nav" user={{ name: 'Lucía Ferrer', role: 'Directora comercial' }} signOutHref="/acceso" />

Examples in context

Real code from the kit: how this piece is used inside templates, sections and other components.

Template Nido · Real Estate Agency & CRM EstateAppLayout.astro
astro
<EstateCrmTopbar
  searchPlaceholder="Buscar propiedades, clientes o referencias…"
  notifications={notifications}
  user={{ name: 'Lucía Ferrer', role: 'Directora comercial', email: 'lucia@nido.example' }}
  userLinks={[{ label: 'Ver web pública', href: routes.home }]}
  signOutHref={routes.signIn}
/>
<EstateCrmTopbar searchPlaceholder="Buscar propiedades, clientes o referencias…" notifications={notifications} user={{ name: 'Lucía Ferrer', role: 'Directora comercial', email: 'lucia@nido.example' }} userLinks={[{ label: 'Ver web pública', href: routes.home }]} signOutHref={routes.signIn} />

Works well with

Manual Installation

If you are not using the npm package, create a new file and paste the following code: src/components/lib/EstateCRMTopbar.astro:

astro
---
/**
 * EstateCrmTopbar — Top bar for the real estate CRM: menu button (mobile), search, theme toggle,
 * notifications and user menu. Menus use the native `popover` attribute, so Escape and
 * clicking outside close them without extra code.
 *
 * @param {string} navId - id of the EstateCrmSidebar the menu button opens. Default 'estate-crm-nav'.
 * @param {string} searchPlaceholder - Search field placeholder.
 * @param {string} searchAction - Search form action (GET, param `q`). Default '#'.
 * @param {Array<{title: string, text?: string, time: string, unread?: boolean}>} notifications - Notification list.
 * @param {{name: string, role?: string, email?: string}} user - Signed-in user.
 * @param {Array<{label: string, href: string}>} userLinks - Links in the user menu.
 * @param {string} signOutHref - Sign-out link.
 * @param {boolean} themeToggle - Show the light/dark toggle. Default true.
 * @param {string} variant - 'blur' | 'solid'. Default 'blur'.
 * @param {string} class - Extra class for the root.
 *
 * Accessibility: <header> landmark; labelled search (role="search"); popover buttons expose
 * aria-expanded via popovertarget; unread count is in the button's name; icons aria-hidden.
 */
import type { HTMLAttributes } from 'astro/types';
import '../templates/real-estate/real-estate-theme.css';

interface Notice { title: string; text?: string; time: string; unread?: boolean }

interface OwnProps {
  navId?: string;
  searchPlaceholder?: string;
  searchAction?: string;
  notifications?: Notice[];
  user?: { name: string; role?: string; email?: string };
  userLinks?: Array<{ label: string; href: string }>;
  signOutHref?: string;
  themeToggle?: boolean;
  variant?: 'blur' | 'solid';
}

type Props = OwnProps & Omit<HTMLAttributes<'header'>, keyof OwnProps | 'class'> & { class?: string };

const {
  navId = 'estate-crm-nav',
  searchPlaceholder = 'Buscar propiedades, clientes o referencias…',
  searchAction = '#',
  notifications = [
    { title: 'Nuevo lead', text: 'Carmen Ruiz pregunta por el ático de Ruzafa', time: 'hace 12 min', unread: true },
    { title: 'Oferta recibida', text: '695.000 € por el piso de Pla del Real', time: 'hace 2 h' },
  ],
  user = { name: 'Lucía Ferrer', role: 'Directora comercial', email: 'lucia@nido.example' },
  userLinks = [],
  signOutHref = '#',
  themeToggle = true,
  variant = 'blur',
  class: classAttr,
  ...rest
} = Astro.props;

const uid = `ect-${Math.random().toString(36).slice(2, 8)}`;
const unread = notifications.filter((n) => n.unread).length;
const initials = user.name.split(/\s+/).map((w) => w[0]).slice(0, 2).join('').toUpperCase();
---

<header class:list={['estate-ui', 'estate-crm-top', `estate-crm-top--${variant}`, classAttr]} data-estate-crm-top {...rest}>
  <button type="button" class="estate-crm-top__btn estate-crm-top__menu" data-estate-crm-toggle={navId} aria-controls={navId} aria-expanded="false">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h16" /></svg>
    <span class="estate-sr">Abrir menú</span>
  </button>

  <form class="estate-crm-top__search" role="search" action={searchAction} method="get">
    <label for={`${uid}-q`} class="estate-sr">Buscar</label>
    <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" /></svg>
    <input id={`${uid}-q`} name="q" type="search" placeholder={searchPlaceholder} autocomplete="off" />
  </form>

  <div class="estate-crm-top__actions">
    {themeToggle && (
      <button type="button" class="estate-crm-top__btn" data-estate-theme aria-pressed="false">
        <svg class="estate-crm-top__sun" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="12" cy="12" r="4" /><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" /></svg>
        <svg class="estate-crm-top__moon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z" /></svg>
        <span class="estate-sr">Tema claro</span>
      </button>
    )}

    <button type="button" class="estate-crm-top__btn" popovertarget={`${uid}-notes`}>
      <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" /><path d="M10.3 21a1.9 1.9 0 0 0 3.4 0" /></svg>
      {unread > 0 && <span class="estate-crm-top__dot" aria-hidden="true">{unread}</span>}
      <span class="estate-sr">Notificaciones{unread > 0 ? `, ${unread} sin leer` : ''}</span>
    </button>
    <div id={`${uid}-notes`} popover class="estate-crm-pop estate-crm-pop--notes" data-estate-pop>
      <p class="estate-crm-pop__title">Notificaciones</p>
      <ul role="list">
        {notifications.map((n) => (
          <li class:list={[{ 'is-unread': n.unread }]}>
            <strong>{n.title}{n.unread && <span class="estate-sr"> (sin leer)</span>}</strong>
            {n.text && <span>{n.text}</span>}
            <small>{n.time}</small>
          </li>
        ))}
      </ul>
    </div>

    <button type="button" class="estate-crm-top__user" popovertarget={`${uid}-user`} aria-label={`Menú de usuario: ${user.name}`}>
      <span class="estate-crm-top__avatar" aria-hidden="true">{initials}</span>
      <span class="estate-crm-top__who">
        <strong>{user.name}</strong>
        {user.role && <small>{user.role}</small>}
      </span>
    </button>
    <div id={`${uid}-user`} popover class="estate-crm-pop estate-crm-pop--user" data-estate-pop>
      <p class="estate-crm-pop__title">{user.name}</p>
      {user.email && <p class="estate-crm-pop__sub">{user.email}</p>}
      <ul role="list">
        {userLinks.map((l) => <li><a href={l.href}>{l.label}</a></li>)}
        <li><a href={signOutHref} class="estate-crm-pop__out">Cerrar sesión</a></li>
      </ul>
    </div>
  </div>
</header>

<script>
  function initTop(root: HTMLElement) {
    if (root.dataset.bound) return;
    root.dataset.bound = 'true';

    // Place each popover under the button that opened it
    root.querySelectorAll<HTMLElement>('[data-estate-pop]').forEach((pop) => {
      pop.addEventListener('toggle', (e) => {
        if ((e as Event & { newState?: string }).newState !== 'open') return;
        const btn = root.querySelector<HTMLElement>(`[popovertarget="${pop.id}"]`);
        if (!btn) return;
        const r = btn.getBoundingClientRect();
        const width = pop.offsetWidth;
        pop.style.top = `${r.bottom + 8}px`;
        pop.style.left = `${Math.max(8, Math.min(window.innerWidth - width - 8, r.right - width))}px`;
      });
    });

    const theme = root.querySelector<HTMLButtonElement>('[data-estate-theme]');
    if (theme) {
      const sync = () => {
        const light = document.documentElement.dataset.theme === 'light';
        theme.setAttribute('aria-pressed', String(light));
      };
      sync();
      theme.addEventListener('click', () => {
        const next = document.documentElement.dataset.theme === 'light' ? 'dark' : 'light';
        document.documentElement.dataset.theme = next;
        try {
          localStorage.setItem('ack-theme', next);
        } catch {
          /* storage unavailable */
        }
        sync();
      });
    }
  }

  function initAll() {
    document.querySelectorAll<HTMLElement>('[data-estate-crm-top]').forEach(initTop);
  }

  initAll();
  document.addEventListener('astro:page-load', initAll);
</script>

<style>
  .estate-crm-top {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: var(--sp-3, 0.75rem);
    min-height: 64px;
    padding: 0 var(--sp-4, 1rem);
    border-bottom: 1px solid var(--estate-border);
    color: var(--estate-text);
    font-family: var(--estate-font-body);
  }

  .estate-crm-top--blur {
    background: color-mix(in srgb, var(--estate-bg) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .estate-crm-top--solid {
    background: var(--estate-bg-raised);
  }

  .estate-crm-top__btn {
    position: relative;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid var(--estate-border);
    border-radius: var(--r-md, 12px);
    background: transparent;
    color: var(--estate-text-2);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .estate-crm-top__btn:hover {
    background: var(--estate-surface);
    color: var(--estate-text);
  }

  .estate-crm-top__menu {
    display: none;
  }

  .estate-crm-top__moon,
  [data-theme='light'] .estate-crm-top__sun {
    display: none;
  }

  [data-theme='light'] .estate-crm-top__moon {
    display: block;
  }

  .estate-crm-top__dot {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background: var(--estate-brand);
    color: var(--estate-on-brand);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
  }

  .estate-crm-top__search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--sp-2, 0.5rem);
    max-width: 520px;
    min-height: 44px;
    padding: 0 var(--sp-3, 0.75rem);
    border-radius: var(--r-md, 12px);
    border: 1px solid var(--estate-border);
    background: var(--estate-surface);
    color: var(--estate-text-3);
  }

  .estate-crm-top__search:focus-within {
    border-color: var(--estate-brand);
  }

  .estate-crm-top__search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--estate-text);
    font: inherit;
    font-size: 0.95rem;
    outline: none;
  }

  .estate-crm-top__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2, 0.5rem);
    margin-left: auto;
  }

  .estate-crm-top__user {
    display: flex;
    align-items: center;
    gap: var(--sp-2, 0.5rem);
    min-height: 44px;
    padding: 0 var(--sp-2, 0.5rem);
    border: 0;
    border-radius: var(--r-md, 12px);
    background: transparent;
    color: var(--estate-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .estate-crm-top__user:hover {
    background: var(--estate-surface);
  }

  .estate-crm-top__avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--estate-sage);
    color: #10140f;
    font-size: 0.8rem;
    font-weight: 700;
  }

  .estate-crm-top__who {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }

  .estate-crm-top__who strong {
    font-size: 0.88rem;
  }

  .estate-crm-top__who small {
    color: var(--estate-text-3);
    font-size: 0.75rem;
  }

  .estate-crm-top :is(button, input):focus-visible {
    outline: 2px solid var(--estate-brand);
    outline-offset: 2px;
  }

  .estate-crm-pop {
    position: fixed;
    inset: auto;
    margin: 0;
    width: min(320px, calc(100vw - 16px));
    padding: var(--sp-3, 0.75rem);
    border-radius: var(--r-lg, 20px);
    border: 1px solid var(--estate-border-strong);
    background: var(--estate-bg-raised);
    color: var(--estate-text);
    font-family: var(--estate-font-body);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  }

  .estate-crm-pop__title {
    margin: 0 0 var(--sp-2, 0.5rem);
    padding: 0 var(--sp-2, 0.5rem);
    font-weight: 700;
  }

  .estate-crm-pop__sub {
    margin: -0.25rem 0 var(--sp-2, 0.5rem);
    padding: 0 var(--sp-2, 0.5rem);
    color: var(--estate-text-3);
    font-size: 0.85rem;
  }

  .estate-crm-pop ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .estate-crm-pop--notes li {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: var(--sp-2, 0.5rem);
    border-radius: var(--r-md, 12px);
    font-size: 0.88rem;
  }

  .estate-crm-pop--notes li.is-unread {
    background: rgba(var(--estate-brand-rgb), 0.1);
  }

  .estate-crm-pop--notes span {
    color: var(--estate-text-2);
  }

  .estate-crm-pop--notes small {
    color: var(--estate-text-3);
  }

  .estate-crm-pop a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--sp-2, 0.5rem);
    border-radius: var(--r-md, 12px);
    color: var(--estate-text);
    text-decoration: none;
  }

  .estate-crm-pop a:hover {
    background: var(--estate-surface);
  }

  .estate-crm-pop a:focus-visible {
    outline: 2px solid var(--estate-brand);
    outline-offset: -2px;
  }

  .estate-crm-pop .estate-crm-pop__out {
    color: var(--estate-down);
  }

  .estate-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  @media (max-width: 959px) {
    .estate-crm-top__menu {
      display: grid;
    }
  }

  @media (max-width: 720px) {
    .estate-crm-top__who {
      display: none;
    }

    .estate-crm-top__search input::placeholder {
      color: transparent;
    }
  }
</style>
--- /** * EstateCrmTopbar — Top bar for the real estate CRM: menu button (mobile), search, theme toggle, * notifications and user menu. Menus use the native `popover` attribute, so Escape and * clicking outside close them without extra code. * * @param {string} navId - id of the EstateCrmSidebar the menu button opens. Default 'estate-crm-nav'. * @param {string} searchPlaceholder - Search field placeholder. * @param {string} searchAction - Search form action (GET, param `q`). Default '#'. * @param {Array<{title: string, text?: string, time: string, unread?: boolean}>} notifications - Notification list. * @param {{name: string, role?: string, email?: string}} user - Signed-in user. * @param {Array<{label: string, href: string}>} userLinks - Links in the user menu. * @param {string} signOutHref - Sign-out link. * @param {boolean} themeToggle - Show the light/dark toggle. Default true. * @param {string} variant - 'blur' | 'solid'. Default 'blur'. * @param {string} class - Extra class for the root. * * Accessibility: <header> landmark; labelled search (role="search"); popover buttons expose * aria-expanded via popovertarget; unread count is in the button's name; icons aria-hidden. */ import type { HTMLAttributes } from 'astro/types'; import '../templates/real-estate/real-estate-theme.css'; interface Notice { title: string; text?: string; time: string; unread?: boolean } interface OwnProps { navId?: string; searchPlaceholder?: string; searchAction?: string; notifications?: Notice[]; user?: { name: string; role?: string; email?: string }; userLinks?: Array<{ label: string; href: string }>; signOutHref?: string; themeToggle?: boolean; variant?: 'blur' | 'solid'; } type Props = OwnProps & Omit<HTMLAttributes<'header'>, keyof OwnProps | 'class'> & { class?: string }; const { navId = 'estate-crm-nav', searchPlaceholder = 'Buscar propiedades, clientes o referencias…', searchAction = '#', notifications = [ { title: 'Nuevo lead', text: 'Carmen Ruiz pregunta por el ático de Ruzafa', time: 'hace 12 min', unread: true }, { title: 'Oferta recibida', text: '695.000 € por el piso de Pla del Real', time: 'hace 2 h' }, ], user = { name: 'Lucía Ferrer', role: 'Directora comercial', email: 'lucia@nido.example' }, userLinks = [], signOutHref = '#', themeToggle = true, variant = 'blur', class: classAttr, ...rest } = Astro.props; const uid = `ect-${Math.random().toString(36).slice(2, 8)}`; const unread = notifications.filter((n) => n.unread).length; const initials = user.name.split(/\s+/).map((w) => w[0]).slice(0, 2).join('').toUpperCase(); --- <header class:list={['estate-ui', 'estate-crm-top', `estate-crm-top--${variant}`, classAttr]} data-estate-crm-top {...rest}> <button type="button" class="estate-crm-top__btn estate-crm-top__menu" data-estate-crm-toggle={navId} aria-controls={navId} aria-expanded="false"> <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h16" /></svg> <span class="estate-sr">Abrir menú</span> </button> <form class="estate-crm-top__search" role="search" action={searchAction} method="get"> <label for={`${uid}-q`} class="estate-sr">Buscar</label> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" /></svg> <input id={`${uid}-q`} name="q" type="search" placeholder={searchPlaceholder} autocomplete="off" /> </form> <div class="estate-crm-top__actions"> {themeToggle && ( <button type="button" class="estate-crm-top__btn" data-estate-theme aria-pressed="false"> <svg class="estate-crm-top__sun" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="12" cy="12" r="4" /><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" /></svg> <svg class="estate-crm-top__moon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z" /></svg> <span class="estate-sr">Tema claro</span> </button> )} <button type="button" class="estate-crm-top__btn" popovertarget={`${uid}-notes`}> <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" /><path d="M10.3 21a1.9 1.9 0 0 0 3.4 0" /></svg> {unread > 0 && <span class="estate-crm-top__dot" aria-hidden="true">{unread}</span>} <span class="estate-sr">Notificaciones{unread > 0 ? `, ${unread} sin leer` : ''}</span> </button> <div id={`${uid}-notes`} popover class="estate-crm-pop estate-crm-pop--notes" data-estate-pop> <p class="estate-crm-pop__title">Notificaciones</p> <ul role="list"> {notifications.map((n) => ( <li class:list={[{ 'is-unread': n.unread }]}> <strong>{n.title}{n.unread && <span class="estate-sr"> (sin leer)</span>}</strong> {n.text && <span>{n.text}</span>} <small>{n.time}</small> </li> ))} </ul> </div> <button type="button" class="estate-crm-top__user" popovertarget={`${uid}-user`} aria-label={`Menú de usuario: ${user.name}`}> <span class="estate-crm-top__avatar" aria-hidden="true">{initials}</span> <span class="estate-crm-top__who"> <strong>{user.name}</strong> {user.role && <small>{user.role}</small>} </span> </button> <div id={`${uid}-user`} popover class="estate-crm-pop estate-crm-pop--user" data-estate-pop> <p class="estate-crm-pop__title">{user.name}</p> {user.email && <p class="estate-crm-pop__sub">{user.email}</p>} <ul role="list"> {userLinks.map((l) => <li><a href={l.href}>{l.label}</a></li>)} <li><a href={signOutHref} class="estate-crm-pop__out">Cerrar sesión</a></li> </ul> </div> </div> </header> <script> function initTop(root: HTMLElement) { if (root.dataset.bound) return; root.dataset.bound = 'true'; // Place each popover under the button that opened it root.querySelectorAll<HTMLElement>('[data-estate-pop]').forEach((pop) => { pop.addEventListener('toggle', (e) => { if ((e as Event & { newState?: string }).newState !== 'open') return; const btn = root.querySelector<HTMLElement>(`[popovertarget="${pop.id}"]`); if (!btn) return; const r = btn.getBoundingClientRect(); const width = pop.offsetWidth; pop.style.top = `${r.bottom + 8}px`; pop.style.left = `${Math.max(8, Math.min(window.innerWidth - width - 8, r.right - width))}px`; }); }); const theme = root.querySelector<HTMLButtonElement>('[data-estate-theme]'); if (theme) { const sync = () => { const light = document.documentElement.dataset.theme === 'light'; theme.setAttribute('aria-pressed', String(light)); }; sync(); theme.addEventListener('click', () => { const next = document.documentElement.dataset.theme === 'light' ? 'dark' : 'light'; document.documentElement.dataset.theme = next; try { localStorage.setItem('ack-theme', next); } catch { /* storage unavailable */ } sync(); }); } } function initAll() { document.querySelectorAll<HTMLElement>('[data-estate-crm-top]').forEach(initTop); } initAll(); document.addEventListener('astro:page-load', initAll); </script> <style> .estate-crm-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--sp-3, 0.75rem); min-height: 64px; padding: 0 var(--sp-4, 1rem); border-bottom: 1px solid var(--estate-border); color: var(--estate-text); font-family: var(--estate-font-body); } .estate-crm-top--blur { background: color-mix(in srgb, var(--estate-bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); } .estate-crm-top--solid { background: var(--estate-bg-raised); } .estate-crm-top__btn { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid var(--estate-border); border-radius: var(--r-md, 12px); background: transparent; color: var(--estate-text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease; } .estate-crm-top__btn:hover { background: var(--estate-surface); color: var(--estate-text); } .estate-crm-top__menu { display: none; } .estate-crm-top__moon, [data-theme='light'] .estate-crm-top__sun { display: none; } [data-theme='light'] .estate-crm-top__moon { display: block; } .estate-crm-top__dot { position: absolute; top: 6px; right: 6px; min-width: 16px; padding: 0 3px; border-radius: 8px; background: var(--estate-brand); color: var(--estate-on-brand); font-size: 0.65rem; font-weight: 700; line-height: 16px; } .estate-crm-top__search { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sp-2, 0.5rem); max-width: 520px; min-height: 44px; padding: 0 var(--sp-3, 0.75rem); border-radius: var(--r-md, 12px); border: 1px solid var(--estate-border); background: var(--estate-surface); color: var(--estate-text-3); } .estate-crm-top__search:focus-within { border-color: var(--estate-brand); } .estate-crm-top__search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--estate-text); font: inherit; font-size: 0.95rem; outline: none; } .estate-crm-top__actions { display: flex; align-items: center; gap: var(--sp-2, 0.5rem); margin-left: auto; } .estate-crm-top__user { display: flex; align-items: center; gap: var(--sp-2, 0.5rem); min-height: 44px; padding: 0 var(--sp-2, 0.5rem); border: 0; border-radius: var(--r-md, 12px); background: transparent; color: var(--estate-text); font: inherit; text-align: left; cursor: pointer; } .estate-crm-top__user:hover { background: var(--estate-surface); } .estate-crm-top__avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--estate-sage); color: #10140f; font-size: 0.8rem; font-weight: 700; } .estate-crm-top__who { display: flex; flex-direction: column; line-height: 1.2; } .estate-crm-top__who strong { font-size: 0.88rem; } .estate-crm-top__who small { color: var(--estate-text-3); font-size: 0.75rem; } .estate-crm-top :is(button, input):focus-visible { outline: 2px solid var(--estate-brand); outline-offset: 2px; } .estate-crm-pop { position: fixed; inset: auto; margin: 0; width: min(320px, calc(100vw - 16px)); padding: var(--sp-3, 0.75rem); border-radius: var(--r-lg, 20px); border: 1px solid var(--estate-border-strong); background: var(--estate-bg-raised); color: var(--estate-text); font-family: var(--estate-font-body); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6); } .estate-crm-pop__title { margin: 0 0 var(--sp-2, 0.5rem); padding: 0 var(--sp-2, 0.5rem); font-weight: 700; } .estate-crm-pop__sub { margin: -0.25rem 0 var(--sp-2, 0.5rem); padding: 0 var(--sp-2, 0.5rem); color: var(--estate-text-3); font-size: 0.85rem; } .estate-crm-pop ul { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; } .estate-crm-pop--notes li { display: flex; flex-direction: column; gap: 0.1rem; padding: var(--sp-2, 0.5rem); border-radius: var(--r-md, 12px); font-size: 0.88rem; } .estate-crm-pop--notes li.is-unread { background: rgba(var(--estate-brand-rgb), 0.1); } .estate-crm-pop--notes span { color: var(--estate-text-2); } .estate-crm-pop--notes small { color: var(--estate-text-3); } .estate-crm-pop a { display: flex; align-items: center; min-height: 44px; padding: 0 var(--sp-2, 0.5rem); border-radius: var(--r-md, 12px); color: var(--estate-text); text-decoration: none; } .estate-crm-pop a:hover { background: var(--estate-surface); } .estate-crm-pop a:focus-visible { outline: 2px solid var(--estate-brand); outline-offset: -2px; } .estate-crm-pop .estate-crm-pop__out { color: var(--estate-down); } .estate-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } @media (max-width: 959px) { .estate-crm-top__menu { display: grid; } } @media (max-width: 720px) { .estate-crm-top__who { display: none; } .estate-crm-top__search input::placeholder { color: transparent; } } </style>

Quick Info

Category
App & Dashboard
Filename
EstateCRMTopbar.astro
Dependencies
None — pure Astro + CSS
Tags
appdashboardsaasreal-estatecrmtopbarsearchpopovershell