About
Horizontal stack that arranges items along the inline axis: left to right in LTR, right to left in RTL. Supports polymorphic rendering. Astryx by Meta. Source: https://astryx.atmeta.com/components/HStack
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx H Stack to your project and fits it to your theme.
Code
How Astryx H Stack is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
'use client';
/* Copyright (c) 2026 Meta Platforms, Inc. See the MIT notice in astryx-h-stack.tsx. */
import '@/components/ui/astryx-h-stack-utils/astryx-preview.css';
import '@astryxdesign/theme-neutral/fonts.css';
import {useSyncExternalStore} from 'react';
import {Theme} from '@astryxdesign/core/theme';
import {neutralTheme} from '@astryxdesign/theme-neutral/built';
import {HStack, VStack} from '@/components/ui/astryx-h-stack';
import {Badge} from '@astryxdesign/core/Badge';
import {Text} from '@astryxdesign/core/Text';
function OfficialSample() {
return (
<VStack gap={6} width="100%" style={{maxWidth: 400}}>
<VStack gap={2}>
<Text type="supporting" color="secondary">
HAlign: start
</Text>
<HStack gap={2}>
<Badge label="React" />
<Badge label="TypeScript" />
<Badge label="Node.js" />
</HStack>
</VStack>
<VStack gap={2}>
<Text type="supporting" color="secondary">
HAlign: center
</Text>
<HStack gap={4} hAlign="center">
<Badge label="Design" />
<Badge label="Engineering" />
<Badge label="Product" />
</HStack>
</VStack>
<VStack gap={2}>
<Text type="supporting" color="secondary">
HAlign: between
</Text>
<HStack gap={2} hAlign="between">
<Badge label="Start" />
<Badge label="Middle" />
<Badge label="End" />
</HStack>
</VStack>
</VStack>
);
}
function readPreviewMode() {
const {classList} = document.documentElement;
return classList.contains('dark') ? 'dark' : 'light';
}
function subscribeToPreviewMode(callback: () => void) {
const observer = new MutationObserver(callback);
observer.observe(document.documentElement, {attributes: true, attributeFilter: ['class']});
return () => observer.disconnect();
}
export default function Demo() {
const mode = useSyncExternalStore(subscribeToPreviewMode, readPreviewMode, () => 'light' as const);
return (
<Theme theme={neutralTheme} mode={mode}>
<div className="astryx-demo">
<div className="astryx-demo-content" data-centered style={{maxWidth: 400}}>
<OfficialSample />
</div>
</div>
</Theme>
);
}







