Skip to content
Layout

Hidden

SSR-safe responsive show/hide via CSS media queries.

Hidden

Hides children with display: none inside breakpoint media queries. Markup stays in the HTML (no useMediaQuery / conditional render), so SSR and hydration match.

hide is mobile-first and-up. Keys are base (0px) plus TypeStyles sm / md / lg / xl. Default at base is visible. When shown, the wrapper uses display: contents.

Examples

Hide from md

Visible below md, hidden from md up.

Demo.tsxtsx
import { Hidden, Text } from '@var-ui/react';

<Hidden hide={{ md: true }} as="aside">
  <Text>Visible below md</Text>
</Hidden>

Show from md

Hidden below md, visible from md up (base: true, then md: false).

Demo.tsxtsx
import { Hidden, Text } from '@var-ui/react';

<Hidden hide={{ base: true, md: false }} as="aside">
  <Text>Visible from md</Text>
</Hidden>

RTL island

DirectionProvider sets dir on a subtree. Side nav and breadcrumbs follow logical properties; chevrons opt into data-mirror.

dir=rtl island

Demo.tsxtsx
import { Breadcrumbs, DirectionProvider, Pagination, SideNav, Text } from '@var-ui/react';

<DirectionProvider direction="rtl">
  <SideNav header={<SideNav.Heading heading="Docs" />}>
    <SideNav.Section title="Main">
      <SideNav.Item label="Overview" href="#overview" isSelected />
      <SideNav.Item label="Guides" collapsible>
        <SideNav.Item label="Hidden" href="#hidden" />
        <SideNav.Item label="Direction" href="#direction" />
      </SideNav.Item>
    </SideNav.Section>
  </SideNav>
  <Breadcrumbs
    items={[
      { id: 'home', label: 'Home', href: '#' },
      { id: 'here', label: 'Current' },
    ]}
  />
  <Pagination page={1} onChange={() => {}} totalPages={5} variant="compact" />
  <Text>dir=rtl island</Text>
</DirectionProvider>

Props

Accessibility

display: none removes the subtree from the accessibility tree while hidden. That is the intended behavior for duplicate navigation. Do not use the HTML hidden attribute — it cannot be scoped to a media query.

Astro and HTML should put hiddenClassName({ hide }) on a real tag (aside, nav) when a landmark matters.