Lynx
HStack
HStack 컴포넌트는 Lynx에서 자식 요소를 가로 방향으로 쌓는 레이아웃 컴포넌트입니다.
Installation
Usage
HStack은 Lynx 네이티브 <view>를 직접 렌더링하며 display="flex"와 flexDirection="row"를 기본 적용합니다. Box를 내부에서 합성하지 않아 반복 렌더링에서 primitive 컴포넌트 단계를 줄입니다.
성능에 민감한 반복 레이아웃을 앱 코드에서 구성할 때는 native <view>/<text>에 Tailwind utility className을 직접 사용하는 방식을 우선 고려하세요. 패키지 컴포넌트 내부에서는 native tag와 recipe className을 사용하고, inline style은 런타임 값이 필요한 경우에만 제한적으로 사용합니다.
Props
Prop
Type
align?(string & {}) | "center" | "flexStart" | "flexEnd" | "stretch" | undefinedjustify?(string & {}) | "center" | "flexStart" | "flexEnd" | "spaceBetween" | "spaceAround" | undefinedwrap?boolean | "nowrap" | "wrap" | undefinedgrow?boolean | Property.FlexGrow | undefinedshrink?boolean | Property.FlexShrink | undefinedleft?0 | (string & {}) | undefinedright?0 | (string & {}) | undefinedalignContent?(string & {}) | "center" | "flexStart" | "flexEnd" | "stretch" | undefinedalignSelf?(string & {}) | "center" | "flexStart" | "flexEnd" | "stretch" | undefinedborderBottomLeftRadius?0 | (string & {}) | "r0_5" | "r1" | "r1_5" | "r2" | "r2_5" | "r3" | "r3_5" | "r4" | "r5" | "r6" | "full" | undefinedborderBottomRightRadius?0 | (string & {}) | "r0_5" | "r1" | "r1_5" | "r2" | "r2_5" | "r3" | "r3_5" | "r4" | "r5" | "r6" | "full" | undefinedborderBottomWidth?0 | (string & {}) | 1 | undefinedborderLeftWidth?0 | (string & {}) | 1 | undefinedborderRightWidth?0 | (string & {}) | 1 | undefinedborderTopLeftRadius?0 | (string & {}) | "r0_5" | "r1" | "r1_5" | "r2" | "r2_5" | "r3" | "r3_5" | "r4" | "r5" | "r6" | "full" | undefinedborderTopRightRadius?0 | (string & {}) | "r0_5" | "r1" | "r1_5" | "r2" | "r2_5" | "r3" | "r3_5" | "r4" | "r5" | "r6" | "full" | undefinedborderTopWidth?0 | (string & {}) | 1 | undefinedbottom?0 | (string & {}) | undefinedcolor?ScopedColorFg | ScopedColorPalette | (string & {}) | undefinedheight?(string & {}) | "full" | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedjustifySelf?Property.JustifySelf | undefinedmaxHeight?(string & {}) | "full" | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedmaxWidth?(string & {}) | "full" | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedminHeight?(string & {}) | "full" | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedminWidth?(string & {}) | "full" | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedoverflowX?(string & {}) | "visible" | "hidden" | undefinedoverflowY?(string & {}) | "visible" | "hidden" | undefinedpaddingBottom?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "safeArea" | undefinedpaddingLeft?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedpaddingRight?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedpaddingTop?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "safeArea" | undefinedposition?(string & {}) | "relative" | "absolute" | "fixed" | undefinedtop?0 | (string & {}) | undefinedwidth?(string & {}) | "full" | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedzIndex?Property.ZIndex | undefinedbackground?ScopedColorPalette | (string & {}) | ScopedColorBg | ScopedColorBanner | undefinedborderColor?ScopedColorPalette | (string & {}) | ScopedColorStroke | undefinedborderRadius?0 | (string & {}) | "r0_5" | "r1" | "r1_5" | "r2" | "r2_5" | "r3" | "r3_5" | "r4" | "r5" | "r6" | "full" | undefinedborderWidth?0 | (string & {}) | 1 | undefinedgap?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedpadding?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedclassName?string | undefinedbindtouchstart?(() => void) | undefinedbindtouchcancel?(() => void) | undefinedbindtouchend?(() => void) | undefinedbindtap?EventHandler<BaseTouchEvent<Target>> | undefinedmain-thread:bindtap?EventHandler<BaseTouchEvent<Element>> | undefinedbg?ScopedColorPalette | (string & {}) | ScopedColorBg | ScopedColorBanner | undefinedp?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedpaddingX?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedpx?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedpaddingY?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedpy?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedpt?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "safeArea" | undefinedpr?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedpb?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "safeArea" | undefinedpl?0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | undefinedstyle?CSSProperties | undefinedchildren?React.ReactNodeLayout Aliases
HStack은 VStack과 동일한 alias를 제공합니다.
| Prop | 적용되는 style |
|---|---|
align | alignItems |
justify | justifyContent |
wrap | flexWrap |
grow | flexGrow |
shrink | flexShrink |
가로 방향에서 줄바꿈이 필요하면 wrap을 사용합니다.
웹 버전과의 차이
Lynx HStack은 React HStack과 다음과 같은 차이가 있습니다.
as,asChild를 지원하지 않습니다. 항상 Lynx 네이티브<view>를 렌더링합니다.Stack이라는 deprecated alias는 제공하지 않습니다. Lynx에서는VStack/HStack을 명시적으로 사용합니다.- 지원하지 않는 StyleProps는
Box와 동일하게 열지 않습니다.
Last updated on