Skip to content

Column

The column component is one of three layout components in Graffiti. It's used to help you position items on the screen. It's based on flexbox and can be used to create a column layout with a fixed width, a flexible width, or a responsive width.

See all the examples and details in the Storybook.

Usage

tsx
import { Column } from "@samgl/graffiti-ui";

const MyColumn = () => {
  return (
    <Column>
      <Heading $level={2}>Some content inside a column</Heading>
      <Text>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean a
          finibus sem, sed imperdiet nibh. Duis nec lorem ipsum. Nulla sagittis
          mi at libero pretium volutpat. Nam interdum quis urna quis cursus.
          Praesent id purus sed lectus finibus dignissim vel et ex. Vestibulum
          ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
          curae; Quisque varius congue tellus ut tempus.
        </p>
      </Text>
    </Column>
  );
};

Props

PropTypeDefaultOptionalDescription
childrenReactNodeThe content of the Column.
$widthstringThe width of the Column.
$heightstringThe height of the Column.
$flexGrownumberThe flex grow factor of the Column.
$gapstringThe gap between the Column and the content.
$justifyContentstringThe justify content of the Column.
$alignItemsstringThe align items of the Column.