Skip to main content

Block stack

Block stack là một component giúp xếp các component theo chiều dọc.

Ví dụ

import { BlockStack } from '@xotiny/preact';
import { FC } from 'preact/compat';

export const BlockStackDemo: FC = () => {
return (
<div>
<BlockStack gap={20} inlineAlign="center">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
</BlockStack>
</div>
);
};

Props

NameTypeDefaultDescription
asElement'div'Thẻ HTML
alignAlign'start'Canh chiều dọc của các phần tử con
inlineAlignInlineAlign'start'Canh chiều ngang của các phần tử con
gapnumber0Khoảng cách giữa các phần tử
reverseOrderbooleanfalseĐảo ngược thứ tự hiển thị của các phần tử