Inline stack
Inline stack là một component giúp xếp các component theo chiều ngang.
Ví dụ
import { InlineStack } from '@xotiny/preact';
import { FC } from 'preact/compat';
export const InlineStackDemo: FC = () => {
return (
<div>
<InlineStack gap={20} align="center" blockAlign="center">
<div style={{ fontSize: 30 }}>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
</InlineStack>
</div>
);
};
Props
Name | Type | Default | Description |
---|---|---|---|
as | Element | 'div' | Thẻ HTML |
align | Align | 'start' | Canh chiều ngang của các phần tử con |
blockAlign | BlockAlign | 'start' | Canh chiều dọc của các phần tử con |
gap | number | 0 | Khoảng cách giữa các phần tử |
direction | Direction | 'row' | Hướng ngang mà các phần tử được sắp xếp |
wrap | boolean | true | Flex wrap css property |