Skip to content

Add "Area" component #305

@kettanaito

Description

@kettanaito

What:

I suggest to introduce an Area component to Atomic Layout.

Why:

Area component would act similarly to Box, but is designed to be used as a direct child of the templateless Composition. Area would accommodate the CSS Grid-related props (column, rowEnd, etc.).

I find this useful for scenarios when I need to align direct Composition children (i.e. specify a child's grid-column) without having to convert the Composition to use template/areas.

Usage example:

import { Composition, Area } from 'atomic-layout'

const Example = () => {
  return (
    <Composition templateCols="1fr 250px">
      <Area columnStart={2}>Content</Area>
    </Composition>
  )
}

Together with the polymorphic as prop the Area component may be used as an augment component that provides grid-related styles to any direct children.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions