npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tachui/responsive

v0.12.1

Published

Advanced responsive design patterns and utilities for tachUI framework

Readme

@tachui/responsive

Responsive design utilities for tachUI applications with breakpoint management and adaptive layouts.

Overview

The @tachui/responsive package provides comprehensive responsive design capabilities for tachUI applications. Build interfaces that automatically adapt to different screen sizes, orientations, and device capabilities with SwiftUI-inspired responsive modifiers.

Installation

npm install @tachui/responsive
# or
pnpm add @tachui/responsive

Core Features

Breakpoint System

Built-in breakpoint system with customizable breakpoints:

import { useBreakpoint, DEFAULT_BREAKPOINTS } from '@tachui/responsive'

// Default breakpoints
const breakpoint = useBreakpoint()

// The exported defaults are CSS lengths, keyed base | sm | md | lg | xl | 2xl
console.log(DEFAULT_BREAKPOINTS)
// {
//   base: '0px',
//   sm: '640px',
//   md: '768px',
//   lg: '1024px',
//   xl: '1280px',
//   '2xl': '1536px',
// }

Responsive Values

Use responsive values throughout your application:

import { VStack, Text } from '@tachui/primitives'

VStack({
  spacing: {
    mobile: 8,
    tablet: 12,
    desktop: 16,
    wide: 20,
  },
  children: [
    Text('Responsive Title')
      .fontSize({
        mobile: 24,
        tablet: 28,
        desktop: 32,
        wide: 36,
      })
      .padding({
        mobile: 16,
        tablet: 20,
        desktop: 24,
      })
      ,
  ],
})

Responsive Modifiers

Size and Spacing

Text('Adaptive Content')
  .padding({
    mobile: 12,
    desktop: 20,
  })
  .margin({
    mobile: { vertical: 8 },
    desktop: { vertical: 16 },
  })
  .width({
    mobile: '100%',
    tablet: '80%',
    desktop: '60%',
  })
  

Layout Adaptations

// Responsive stack direction
VStack({
  direction: {
    mobile: 'vertical',
    tablet: 'horizontal',
  },
  children: [Text('Item 1'), Text('Item 2'), Text('Item 3')],
})

Typography Scaling

Text('Responsive Typography')
  .font({
    mobile: { size: 16, weight: 400 },
    tablet: { size: 18, weight: 500 },
    desktop: { size: 20, weight: 600 },
  })
  .lineHeight({
    mobile: 1.4,
    desktop: 1.6,
  })
  .textAlign({
    mobile: 'left',
    tablet: 'center',
  })
  

Advanced Responsive Patterns

Responsive Grid

import { Grid } from '@tachui/grid'

Grid({
  columns: {
    mobile: 1,
    tablet: 2,
    desktop: 3,
    wide: 4,
  },
  gap: {
    mobile: 12,
    desktop: 20,
  },
  children: items.map(item =>
    Card({ title: item.title, content: item.content })
  ),
})

Adaptive Navigation

const navigationStyle = {
  mobile: 'bottom-tabs',
  tablet: 'sidebar',
  desktop: 'top-nav',
}

Show({
  when: () => useBreakpoint() === 'mobile',
  children: BottomTabNavigation(),
  fallback: Show({
    when: () => useBreakpoint() === 'tablet',
    children: SidebarNavigation(),
    fallback: TopNavigation(),
  }),
})

Responsive Utilities

Breakpoint Helpers

import {
  getCurrentBreakpoint,
  isBreakpointAbove,
  isBreakpointBelow,
  getBreakpointsAbove,
} from '@tachui/responsive'

// `getCurrentBreakpoint()` hands back a Signal, so call it to read the key
const currentBreakpoint = getCurrentBreakpoint()
const current = currentBreakpoint()

// Comparisons take two breakpoint keys — base | sm | md | lg | xl | 2xl
if (isBreakpointAbove(current, 'md')) {
  // wider than the md breakpoint
}

if (isBreakpointBelow(current, 'lg')) {
  // narrower than the lg breakpoint
}

// Every breakpoint wider than the given one
const wider = getBreakpointsAbove('md')

Performance Optimization

Efficient Re-renders

// Reactive responsive values with minimal re-renders
const fontSize = createMemo(() => {
  const bp = useBreakpoint()
  switch (bp()) {
    case 'mobile':
      return 14
    case 'tablet':
      return 16
    case 'desktop':
      return 18
    default:
      return 20
  }
})

Text('Optimized Text').fontSize(fontSize)

Integration Examples

With Navigation

import { NavigationView } from '@tachui/navigation'

NavigationView({
  navigationStyle: {
    mobile: 'stack',
    tablet: 'split',
    desktop: 'sidebar',
  },
  children: [HomePage(), ProfilePage(), SettingsPage()],
})

With Forms

import { Form, TextField } from '@tachui/forms'

Form({
  layout: {
    mobile: 'vertical',
    desktop: 'horizontal',
  },
  children: [
    TextField({
      label: 'Name',
      width: {
        mobile: '100%',
        desktop: '50%',
      },
    }),
    TextField({
      label: 'Email',
      width: {
        mobile: '100%',
        desktop: '50%',
      },
    }),
  ],
})

Not implemented yet

Documented here before they existed; the examples did not run. Listed so the gap is visible rather than found at the import, with the nearest real thing:

| Documented | Actually available | | --- | --- | | breakpoints | DEFAULT_BREAKPOINTS, configureBreakpoints | | ResponsiveContainer, ContainerQuery | Container, ResponsiveContainerPatterns | | MediaQuery | useMediaQuery, MediaQueries, generateMediaQuery | | useViewportSize, ViewportSize | getViewportDimensions | | useDeviceType, DeviceType, useOrientation | useBreakpoint is the closest; no device or orientation API | | responsive(), createResponsiveStyles | withResponsive, createResponsiveModifier, createResponsiveCSSVariables | | createBreakpoints | configureBreakpoints | | LazyBreakpoint, ServerResponsiveProvider | no equivalent |

Accessibility Considerations

  • Reduced Motion: Respects user's motion preferences
  • High Contrast: Adapts to high contrast mode
  • Screen Reader: Provides appropriate breakpoint information
Text('Accessible responsive content')
  .fontSize({
    mobile: 16,
    desktop: 18,
  })
  .accessibilityLabel(() => `Text size adapts to ${useBreakpoint()} screen`)
  

Browser Support

  • Modern browsers with CSS3 media query support
  • Graceful fallback for older browsers
  • Progressive enhancement for advanced features

Contributing

See the contributing guide for information on extending the responsive system.

License

This package is part of the tachUI framework and is licensed under the MPL-2.0 License.