Lynx
HStack
HStack 컴포넌트는 Lynx에서 자식 요소를 가로 방향으로 쌓는 레이아웃 컴포넌트입니다.
사용을 권장하지 않아요
레이아웃은 사용 중인 zero-runtime 스타일링 라이브러리로 구성하는 것을 권장합니다. 이유와 대체 예제는 Styling 가이드에서 확인하세요.
Installation
Usage
HStack은 Lynx 네이티브 <view>를 직접 렌더링하며 display="flex"와 flexDirection="row"를 기본 적용합니다. Box를 내부에서 합성하지 않아 반복 렌더링에서 primitive 컴포넌트 단계를 줄입니다.
Props
Prop
Type
bg?ScopedColorBanner | ScopedColorBg | ScopedColorPalette | (string & {}) | undefinedbackground?ScopedColorBanner | ScopedColorBg | ScopedColorPalette | (string & {}) | undefinedcolor?ScopedColorFg | ScopedColorPalette | (string & {}) | undefinedborderColor?ScopedColorPalette | ScopedColorStroke | (string & {}) | undefinedborderWidth?0 | 1 | (string & {}) | undefinedborderTopWidth?0 | 1 | (string & {}) | undefinedborderRightWidth?0 | 1 | (string & {}) | undefinedborderBottomWidth?0 | 1 | (string & {}) | undefinedborderLeftWidth?0 | 1 | (string & {}) | undefinedborderRadius?"full" | "r0_5" | "r1" | "r1_5" | "r2" | "r2_5" | "r3" | "r3_5" | "r4" | "r5" | "r6" | 0 | (string & {}) | undefinedborderTopLeftRadius?"full" | "r0_5" | "r1" | "r1_5" | "r2" | "r2_5" | "r3" | "r3_5" | "r4" | "r5" | "r6" | 0 | (string & {}) | undefinedborderTopRightRadius?"full" | "r0_5" | "r1" | "r1_5" | "r2" | "r2_5" | "r3" | "r3_5" | "r4" | "r5" | "r6" | 0 | (string & {}) | undefinedborderBottomRightRadius?"full" | "r0_5" | "r1" | "r1_5" | "r2" | "r2_5" | "r3" | "r3_5" | "r4" | "r5" | "r6" | 0 | (string & {}) | undefinedborderBottomLeftRadius?"full" | "r0_5" | "r1" | "r1_5" | "r2" | "r2_5" | "r3" | "r3_5" | "r4" | "r5" | "r6" | 0 | (string & {}) | undefinedwidth?"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {}) | undefinedminWidth?"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {}) | undefinedmaxWidth?"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {}) | undefinedheight?"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {}) | undefinedminHeight?"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {}) | undefinedmaxHeight?"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {}) | undefinedtop?0 | (string & {}) | undefinedleft?0 | (string & {}) | undefinedright?0 | (string & {}) | undefinedbottom?0 | (string & {}) | undefinedpadding?"spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedp?"spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpaddingX?"spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpx?"spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpaddingY?"spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpy?"spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpaddingTop?"safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpt?"safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpaddingRight?"safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpr?"safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpaddingBottom?"safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpb?"safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpaddingLeft?"safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedpl?"safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedposition?"absolute" | "fixed" | "relative" | (string & {}) | undefinedoverflowX?"hidden" | "visible" | (string & {}) | undefinedoverflowY?"hidden" | "visible" | (string & {}) | undefinedzIndex?Property.ZIndex | undefinedjustifySelf?Property.JustifySelf | undefinedalignContent?"center" | "flexEnd" | "flexStart" | "stretch" | (string & {}) | undefinedalignSelf?"center" | "flexEnd" | "flexStart" | "stretch" | (string & {}) | undefinedgap?"spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {}) | undefinedbleed?BleedValue | undefinedbleedX?BleedValue | undefinedbleedY?BleedValue | undefinedbleedTop?BleedValue | undefinedbleedRight?BleedValue | undefinedbleedBottom?BleedValue | undefinedbleedLeft?BleedValue | undefinedmargin?MarginValue | undefinedm?MarginValue | undefinedmarginX?MarginValue | undefinedmx?MarginValue | undefinedmarginY?MarginValue | undefinedmy?MarginValue | undefinedmarginTop?MarginValue | undefinedmt?MarginValue | undefinedmarginRight?MarginValue | undefinedmr?MarginValue | undefinedmarginBottom?MarginValue | undefinedmb?MarginValue | undefinedmarginLeft?MarginValue | undefinedml?MarginValue | undefinedalign?"center" | "flexEnd" | "flexStart" | "stretch" | (string & {}) | undefinedjustify?"center" | "flexEnd" | "flexStart" | "spaceAround" | "spaceBetween" | (string & {}) | undefinedwrap?"nowrap" | "wrap" | boolean | undefinedgrow?boolean | Property.FlexGrow | undefinedshrink?boolean | Property.FlexShrink | undefinedLayout 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>를 렌더링합니다.- 지원하지 않는 StyleProps는
Box와 동일하게 열지 않습니다.
Last updated on