Parameters
A single child component or an array of child components to arrange horizontally.
Configuration options for the horizontal stack.
A view that arranges its children in a horizontal line.
HStack(children: Component): Component;
HStack(children: Component[]): Component;
HStack(props: { spacing?: number, alignment?: VerticalAlignment }, children: Component[]): Component;
HStack([
Text("First"),
Text("Second"),
Text("Third")
])
HStack({ spacing: 52 }, [
Button("Previous", () => {}),
Button("Next", () => {})
])
HStack({ alignment: "center" }, [
Image("icon.png").frame({ width: 24, height: 24 }),
Text("Icon with text")
])
HStack({ spacing: 12, alignment: "top" }, [
VStack([
Text("Title").font("headline"),
Text("Subtitle").font("subheadline")
]),
Spacer(),
Button("Action", () => {})
]).padding(20)